This fixes 'split -l NNN foo'. As it stands split will

complain about an 'illegal line count' becuase it's looking
at the wrong end pointer (ep) to detect any extra characters
after the NNN.

Submitted by:	Rich Murphey <rich@freebsd.org>

This should probably get pulled into 2.0.6 and 2.1.0
This commit is contained in:
Rodney W. Grimes 1995-07-07 08:23:52 +00:00
parent ef59de8517
commit a3f8d23a48

View File

@ -110,7 +110,7 @@ main(argc, argv)
case 'l': /* Line count. */
if (numlines != 0)
usage();
if ((numlines = strtol(optarg, &ep, 10)) <= 0 || *p)
if ((numlines = strtol(optarg, &ep, 10)) <= 0 || *ep)
errx(1, "%s: illegal line count.", optarg);
break;
default: