aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Becker <stefanb@gpartner-nvidia.com>2016-04-07 13:29:03 +0300
committerStefan Becker <stefanb@gpartner-nvidia.com>2016-04-12 12:31:46 +0300
commit167e1f750dfed276d50ad93ebf0ce0a1f6e6f9ac (patch)
treec8678f46a282ecb07209e4e4c1275106a2b1af30
parent187bf08e7fc847da6dc8482383fa5c8364f0ac50 (diff)
downloadandroid_build_kati-167e1f750dfed276d50ad93ebf0ce0a1f6e6f9ac.tar.gz
android_build_kati-167e1f750dfed276d50ad93ebf0ce0a1f6e6f9ac.tar.bz2
android_build_kati-167e1f750dfed276d50ad93ebf0ce0a1f6e6f9ac.zip
[C++] Ignore white space around $(call) function name
Regression when compared to GNU make behaviour. Test case: $ cat Makefile.call-func-name func = $(info called with '$(1)') test = $(call $(1),$(1)) $(call test,func) $(call test, func) $(call test,func ) $(call test, func ) $ make -f Makefile.call-func-name called with 'func' called with ' func' called with 'func ' called with ' func ' make: *** No targets. Stop. $ ckati -c --warn -f Makefile.call-func-name called with 'func' Makefile.call-func-name:5: *warning*: undefined user function: func Makefile.call-func-name:6: *warning*: undefined user function: func Makefile.call-func-name:5: *warning*: undefined user function: func *** No targets. Fixes https://github.com/google/kati/issues/49 Change-Id: I3d982cd8d6d9777034df64540c32846300cb72f2
-rw-r--r--func.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/func.cc b/func.cc
index 876b274..e313c9e 100644
--- a/func.cc
+++ b/func.cc
@@ -583,7 +583,7 @@ void CallFunc(const vector<Value*>& args, Evaluator* ev, string* s) {
Intern("5"), Intern("6"), Intern("7"), Intern("8"), Intern("9")
};
- const string&& func_name = args[0]->Eval(ev);
+ const string&& func_name = TrimSpace(args[0]->Eval(ev)).as_string();
Var* func = ev->LookupVar(Intern(func_name));
if (!func->IsDefined()) {
KATI_WARN("%s:%d: *warning*: undefined user function: %s",