diff --git a/ChangeLog b/ChangeLog index 22a8e6a2..ac642aae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * src/support.h: Prevent compile errors in plugins when GETTEXT_PACKAGE is not defined. + * tagmanager/make.c: + Fix crash in Makefile parser when trying to read defines. 2009-01-03 Nick Treleaven diff --git a/tagmanager/make.c b/tagmanager/make.c index 39a91ebc..f59ce46f 100644 --- a/tagmanager/make.c +++ b/tagmanager/make.c @@ -110,8 +110,12 @@ static void newMacro (vString *const name) static void newMacroFromDefine (vString *const name) { /* name is something like "define JAVAHPP_RULE", find the space and jump to the next char */ - vStringCopyS (name, strchr (vStringValue (name), ' ') + 1); - makeSimpleTag (name, MakeKinds, K_MACRO); + char *name_val = strchr (vStringValue (name), ' '); + + if (name_val != NULL) { + vStringCopyS (name, name_val + 1); + makeSimpleTag (name, MakeKinds, K_MACRO); + } } static void readIdentifier (const int first, vString *const id)