From 9bc5857f899016efab507419e538fe67c0118c09 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Fri, 20 May 2016 09:18:58 +0900 Subject: [PATCH] make: fix a typo in parenthesis handling Signed-off-by: Masatake YAMATO Signed-off-by: Colomban Wendling X-Universal-CTags-Commit-ID: 39c1236cc1a40aac6b93c60537d30489912bbbb2 X-Universal-CTags-Issue: universal-ctags/ctags#944 --- tagmanager/ctags/make.c | 2 +- tests/ctags/Makefile.am | 1 + tests/ctags/make-parentheses.mak | 6 ++++++ tests/ctags/make-parentheses.mak.tags | 5 +++++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/ctags/make-parentheses.mak create mode 100644 tests/ctags/make-parentheses.mak.tags diff --git a/tagmanager/ctags/make.c b/tagmanager/ctags/make.c index 195dfa2f0..ea777e45e 100644 --- a/tagmanager/ctags/make.c +++ b/tagmanager/ctags/make.c @@ -110,7 +110,7 @@ static void readIdentifier (const int first, vString *const id) vStringClear (id); while (isIdentifier (c) || (depth > 0 && c != EOF && c != '\n')) { - if (c == '(' || c == '}') + if (c == '(' || c == '{') depth++; else if (depth > 0 && (c == ')' || c == '}')) depth--; diff --git a/tests/ctags/Makefile.am b/tests/ctags/Makefile.am index 23d1bfbb7..56c576b61 100644 --- a/tests/ctags/Makefile.am +++ b/tests/ctags/Makefile.am @@ -211,6 +211,7 @@ test_sources = \ make-comment-in-rule.mak \ make-gnumake-pattern-rules.mak \ make-multi-target.mak \ + make-parentheses.mak \ make-target-with-parentheses.mak \ make-variable-on-cmdline.mak \ masm.asm \ diff --git a/tests/ctags/make-parentheses.mak b/tests/ctags/make-parentheses.mak new file mode 100644 index 000000000..d38c2924d --- /dev/null +++ b/tests/ctags/make-parentheses.mak @@ -0,0 +1,6 @@ +A=X.c +B=Y.c +$(A)-$(A:.c=.o): + echo $@ +${B}-${B:.c=.o}: + echo $@ diff --git a/tests/ctags/make-parentheses.mak.tags b/tests/ctags/make-parentheses.mak.tags new file mode 100644 index 000000000..20f3b72d5 --- /dev/null +++ b/tests/ctags/make-parentheses.mak.tags @@ -0,0 +1,5 @@ +# format=tagmanager +$(A)-$(A:.c=.o)Ì16Ö0 +${B}-${B:.c=.o}Ì16Ö0 +AÌ65536Ö0 +BÌ65536Ö0 -- 2.11.4.GIT