diff options
| author | Paul Eggert | 2015-05-24 14:20:09 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-05-24 14:20:09 -0700 |
| commit | 3441b0cc61d88edb921bbf27462f3f961e794b4d (patch) | |
| tree | c05368e518153c345be1f55823cd8e7144788c29 /lib-src | |
| parent | efa6f10a8efe6a917dd6d416a1a6626d12fc7942 (diff) | |
| download | emacs-3441b0cc61d88edb921bbf27462f3f961e794b4d.tar.gz emacs-3441b0cc61d88edb921bbf27462f3f961e794b4d.zip | |
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) | |||
| 1484 | error ("skipping inclusion of %s in self.", file); | 1484 | error ("skipping inclusion of %s in self.", file); |
| 1485 | return; | 1485 | return; |
| 1486 | } | 1486 | } |
| 1487 | if ((compr = get_compressor_from_suffix (file, &ext)) == NULL) | 1487 | compr = get_compressor_from_suffix (file, &ext); |
| 1488 | if (compr) | ||
| 1488 | { | 1489 | { |
| 1489 | compressed_name = NULL; | 1490 | real_name = compressed_name = savestr (file); |
| 1490 | real_name = uncompressed_name = savestr (file); | 1491 | uncompressed_name = savenstr (file, ext - file); |
| 1491 | } | 1492 | } |
| 1492 | else | 1493 | else |
| 1493 | { | 1494 | { |
| 1494 | real_name = compressed_name = savestr (file); | 1495 | compressed_name = NULL; |
| 1495 | uncompressed_name = savenstr (file, ext - file); | 1496 | real_name = uncompressed_name = savestr (file); |
| 1496 | } | 1497 | } |
| 1497 | 1498 | ||
| 1498 | /* If the canonicalized uncompressed name | 1499 | /* If the canonicalized uncompressed name |
| @@ -4299,8 +4300,8 @@ Perl_functions (FILE *inf) | |||
| 4299 | cp++; | 4300 | cp++; |
| 4300 | if (cp == sp) | 4301 | if (cp == sp) |
| 4301 | continue; /* nothing found */ | 4302 | continue; /* nothing found */ |
| 4302 | if ((pos = strchr (sp, ':')) != NULL | 4303 | pos = strchr (sp, ':'); |
| 4303 | && pos < cp && pos[1] == ':') | 4304 | if (pos && pos < cp && pos[1] == ':') |
| 4304 | /* The name is already qualified. */ | 4305 | /* The name is already qualified. */ |
| 4305 | make_tag (sp, cp - sp, true, | 4306 | make_tag (sp, cp - sp, true, |
| 4306 | lb.buffer, cp - lb.buffer + 1, lineno, linecharno); | 4307 | lb.buffer, cp - lb.buffer + 1, lineno, linecharno); |
| @@ -5051,8 +5052,8 @@ TEX_decode_env (const char *evarname, const char *defenv) | |||
| 5051 | env = concat (env, defenv, ""); | 5052 | env = concat (env, defenv, ""); |
| 5052 | 5053 | ||
| 5053 | /* Allocate a token table */ | 5054 | /* Allocate a token table */ |
| 5054 | for (len = 1, p = env; p;) | 5055 | for (len = 1, p = env; (p = strchr (p, ':')); ) |
| 5055 | if ((p = strchr (p, ':')) && *++p != '\0') | 5056 | if (*++p) |
| 5056 | len++; | 5057 | len++; |
| 5057 | TEX_toktab = xnew (len, linebuffer); | 5058 | TEX_toktab = xnew (len, linebuffer); |
| 5058 | 5059 | ||