From 06eac9f17d20d063ba1241f6761be644ca07d53c Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Tue, 23 Jan 2018 09:50:56 +0200 Subject: [PATCH] (etags_set_definition_hash): make buf stack variable. Signed-off-by: Andrew V. Samoilov --- src/editor/etags.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/editor/etags.c b/src/editor/etags.c index 096ca0783..70a253641 100644 --- a/src/editor/etags.c +++ b/src/editor/etags.c @@ -54,7 +54,7 @@ /* --------------------------------------------------------------------------------------------- */ static gboolean -parse_define (char *buf, char **long_name, char **short_name, long *line) +parse_define (const char *buf, char **long_name, char **short_name, long *line) { /* *INDENT-OFF* */ enum @@ -183,7 +183,7 @@ etags_set_definition_hash (const char *tagfile, const char *start_path, /* *INDENT-ON* */ FILE *f; - static char buf[BUF_LARGE]; + char buf[BUF_LARGE]; char *chekedstr = NULL; @@ -241,14 +241,7 @@ etags_set_definition_hash (const char *tagfile, const char *start_path, canonicalize_pathname (def_hash[num].fullpath); def_hash[num].filename = g_strdup (filename); - if (shortname) - { - def_hash[num].short_define = g_strdup (shortname); - } - else - { - def_hash[num].short_define = g_strdup (longname); - } + def_hash[num].short_define = g_strdup (shortname ? shortname : longname); def_hash[num].line = line; num++; }