diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-05-24 14:20:09 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-05-24 14:20:09 -0700 |
commit | 3441b0cc61d88edb921bbf27462f3f961e794b4d (patch) | |
tree | c05368e518153c345be1f55823cd8e7144788c29 /lib-src | |
parent | efa6f10a8efe6a917dd6d416a1a6626d12fc7942 (diff) | |
download | emacs-3441b0cc61d88edb921bbf27462f3f961e794b4d.tar.gz |
etags.c: avoid side effects in 'if'
* lib-src/etags.c (process_file_name, Perl_functions)
(TEX_decode_env): Hoist side effects into previous statement.
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/etags.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index f049f42b442..ea337d41008 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -1484,15 +1484,16 @@ process_file_name (char *file, language *lang) error ("skipping inclusion of %s in self.", file); return; } - if ((compr = get_compressor_from_suffix (file, &ext)) == NULL) + compr = get_compressor_from_suffix (file, &ext); + if (compr) { - compressed_name = NULL; - real_name = uncompressed_name = savestr (file); + real_name = compressed_name = savestr (file); + uncompressed_name = savenstr (file, ext - file); } else { - real_name = compressed_name = savestr (file); - uncompressed_name = savenstr (file, ext - file); + compressed_name = NULL; + real_name = uncompressed_name = savestr (file); } /* If the canonicalized uncompressed name @@ -4299,8 +4300,8 @@ Perl_functions (FILE *inf) cp++; if (cp == sp) continue; /* nothing found */ - if ((pos = strchr (sp, ':')) != NULL - && pos < cp && pos[1] == ':') + pos = strchr (sp, ':'); + if (pos && pos < cp && pos[1] == ':') /* The name is already qualified. */ make_tag (sp, cp - sp, true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); @@ -5051,8 +5052,8 @@ TEX_decode_env (const char *evarname, const char *defenv) env = concat (env, defenv, ""); /* Allocate a token table */ - for (len = 1, p = env; p;) - if ((p = strchr (p, ':')) && *++p != '\0') + for (len = 1, p = env; (p = strchr (p, ':')); ) + if (*++p) len++; TEX_toktab = xnew (len, linebuffer); |