bin/85099: POSIX violation in split(1)
Toby Peterson
toby at apple.com
Thu Aug 18 22:30:20 GMT 2005
>Number: 85099
>Category: bin
>Synopsis: POSIX violation in split(1)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Aug 18 22:30:16 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Toby Peterson
>Release: HEAD
>Organization:
Apple Computer, Inc.
>Environment:
n/a
>Description:
split(1) violates the POSIX specification, in that it will use prefixes x-z by default. POSIX only allows x.
>How-To-Repeat:
Run split, observe that i'll create 3 times more files than POSIX allows.
>Fix:
Index: split.1
===================================================================
RCS file: /home/ncvs/src/usr.bin/split/split.1,v
retrieving revision 1.15
diff -u -r1.15 split.1
--- split.1 17 Jan 2005 07:44:29 -0000 1.15
+++ split.1 18 Aug 2005 22:25:59 -0000
@@ -111,8 +111,8 @@
If the
.Ar name
argument is not specified, the file is split into lexically ordered
-files named with prefixes in the range of
-.Dq Li x-z
+files named with the prefix
+.Dq Li x
and with suffixes as above.
.Sh ENVIRONMENT
The
@@ -139,12 +139,10 @@
command appeared in
.At v3 .
.Sh BUGS
-For historical reasons, if you specify
-.Ar name ,
+For historical reasons,
.Nm
can only create 676 separate
files.
-The default naming convention allows 2028 separate files.
The
.Fl a
option can be used to work around this limitation.
Index: split.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/split/split.c,v
retrieving revision 1.15
diff -u -r1.15 split.c
--- split.c 11 Jul 2004 14:44:23 -0000 1.15
+++ split.c 18 Aug 2005 22:25:59 -0000
@@ -319,15 +319,8 @@
if ((maxfiles *= 26) <= 0)
errx(EX_USAGE, "suffix is too long (max %ld)", i);
- /*
- * Hack to increase max files; original code wandered through
- * magic characters.
- */
if (fnum == maxfiles) {
- if (!defname || fname[0] == 'z')
- errx(EX_DATAERR, "too many files");
- ++fname[0];
- fnum = 0;
+ errx(EX_DATAERR, "too many files");
}
/* Generate suffix of sufflen letters */
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list