summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-05-20 11:52:36 +0000
committerJim Meyering <jim@meyering.net>1995-05-20 11:52:36 +0000
commit9918713e5b162644cf1c710be7e6afff0316b348 (patch)
treedb11a8391a7f9a10c8e3dd391603629c58f203d8 /src/split.c
parent4c9e84124c8f22ec8be7b793052a4bdd20a560ca (diff)
downloadcoreutils-9918713e5b162644cf1c710be7e6afff0316b348.tar.xz
(next_file_name): Move dcls of file-scope variables into this function.
Don't rely on arithmetic being two's complement.
Diffstat (limited to 'src/split.c')
-rw-r--r--src/split.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/split.c b/src/split.c
index ebb3910e3..29beaab03 100644
--- a/src/split.c
+++ b/src/split.c
@@ -56,11 +56,6 @@ static char *outfile_mid;
/* Pointer to the end of OUTFILE. */
static char *outfile_end;
-/* Status for outfile name generation. */
-static unsigned outfile_count = -1;
-static unsigned outfile_name_limit = 25 * 26;
-static unsigned outfile_name_generation = 1;
-
/* Name of input file. May be "-". */
static char *infile;
@@ -557,7 +552,16 @@ next_file_name ()
char *ne;
unsigned int i;
- outfile_count++;
+ static int first_call = 1;
+
+ /* Status for outfile name generation. */
+ static unsigned outfile_count = 0;
+ static unsigned outfile_name_limit = 25 * 26;
+ static unsigned outfile_name_generation = 1;
+
+ if (!first_call)
+ outfile_count++;
+ first_call = 0;
if (outfile_count < outfile_name_limit)
{
for (ne = outfile_end - 1; ; ne--)