diff options
author | Jim Meyering <jim@meyering.net> | 1998-01-16 23:23:04 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-01-16 23:23:04 +0000 |
commit | b8a16a3f2a9fefe70a4339f30602ebb5a718f524 (patch) | |
tree | 9660973a132b216ae71cdb0d0b43a50d526a7f1c | |
parent | f1217e49766293874df5ad05db7bfbafbf1985c7 (diff) | |
download | coreutils-b8a16a3f2a9fefe70a4339f30602ebb5a718f524.tar.xz |
(mergefps): Add braces to avoid ambiguous `else' statement.
(nls_set_fraction): Likewise.
-rw-r--r-- | src/sort.c | 88 |
1 files changed, 46 insertions, 42 deletions
diff --git a/src/sort.c b/src/sort.c index 8d14a4b5d..206de7fca 100644 --- a/src/sort.c +++ b/src/sort.c @@ -1059,26 +1059,28 @@ static void nls_set_fraction (register unsigned char ch) { if (!nls_fraction_found && ch != decimal_point) - if (ch == FLOATING_POINT) - { /* US style */ - decimal_point = FLOATING_POINT; - th_sep = FLOATING_COMMA; - } - else if (ch == FLOATING_COMMA) - { /* EU style */ - decimal_point = FLOATING_COMMA; - th_sep = FLOATING_POINT; - } - else if (ch != decimal_point) - { /* Alien */ - decimal_point = ch; - th_sep = '\0'; - } + { + if (ch == FLOATING_POINT) + { /* US style */ + decimal_point = FLOATING_POINT; + th_sep = FLOATING_COMMA; + } + else if (ch == FLOATING_COMMA) + { /* EU style */ + decimal_point = FLOATING_COMMA; + th_sep = FLOATING_POINT; + } + else if (ch != decimal_point) + { /* Alien */ + decimal_point = ch; + th_sep = '\0'; + } + } nls_fraction_found = 1; } /* Look for a fraction - It ain't as simple as it looks... however, consider a number: + It isn't as simple as it looks... however, consider a number: 1.234,00 1,234.00 It's easy to tell which is a decimal point, and which isn't. We use @@ -2024,32 +2026,34 @@ mergefps (FILE **fps, register int nfps, FILE *ofp) /* Check if we need to read more lines into core. */ if (++cur[ord[0]] == lines[ord[0]].used) - if (fillbuf (&buffer[ord[0]], fps[ord[0]])) - { - findlines (&buffer[ord[0]], &lines[ord[0]]); - cur[ord[0]] = 0; - } - else - { - /* We reached EOF on fps[ord[0]]. */ - for (i = 1; i < nfps; ++i) - if (ord[i] > ord[0]) - --ord[i]; - --nfps; - xfclose (fps[ord[0]]); - free (buffer[ord[0]].buf); - free ((char *) lines[ord[0]].lines); - for (i = ord[0]; i < nfps; ++i) - { - fps[i] = fps[i + 1]; - buffer[i] = buffer[i + 1]; - lines[i] = lines[i + 1]; - cur[i] = cur[i + 1]; - } - for (i = 0; i < nfps; ++i) - ord[i] = ord[i + 1]; - continue; - } + { + if (fillbuf (&buffer[ord[0]], fps[ord[0]])) + { + findlines (&buffer[ord[0]], &lines[ord[0]]); + cur[ord[0]] = 0; + } + else + { + /* We reached EOF on fps[ord[0]]. */ + for (i = 1; i < nfps; ++i) + if (ord[i] > ord[0]) + --ord[i]; + --nfps; + xfclose (fps[ord[0]]); + free (buffer[ord[0]].buf); + free ((char *) lines[ord[0]].lines); + for (i = ord[0]; i < nfps; ++i) + { + fps[i] = fps[i + 1]; + buffer[i] = buffer[i + 1]; + lines[i] = lines[i + 1]; + cur[i] = cur[i + 1]; + } + for (i = 0; i < nfps; ++i) + ord[i] = ord[i + 1]; + continue; + } + } /* The new line just read in may be larger than other lines already in core; push it back in the queue until we encounter |