summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjwd <jwd@FreeBSD.org>2000-11-19 01:44:20 +0000
committerjwd <jwd@FreeBSD.org>2000-11-19 01:44:20 +0000
commitefaee5cdfcbee97e679b3159204a2b5512f4c951 (patch)
tree4f9ae724cefc26b876fa76502febf4865dc1358d
parent2ace35208525bb250b47fe7af60ec2ce681c6c92 (diff)
downloadFreeBSD-src-efaee5cdfcbee97e679b3159204a2b5512f4c951.zip
FreeBSD-src-efaee5cdfcbee97e679b3159204a2b5512f4c951.tar.gz
Add/fix the ability to split a file larger than 2 gigabytes.
Added $FreeBSD tag (in the way the already present sccsid is done). I've been told the rcsid stuff may be of dubious value so I'm curious to know if folks (still) use it. Submitted by: Brad Chisholm <blc@bsdwins.com>
-rw-r--r--usr.bin/split/split.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c
index 602c1d8..b31371d 100644
--- a/usr.bin/split/split.c
+++ b/usr.bin/split/split.c
@@ -40,6 +40,9 @@ static const char copyright[] =
#ifndef lint
#if 0
static char sccsid[] = "@(#)split.c 8.2 (Berkeley) 4/16/94";
+#else
+static const char rcsid[] =
+ "$FreeBSD$";
#endif
#endif /* not lint */
@@ -58,7 +61,7 @@ static char sccsid[] = "@(#)split.c 8.2 (Berkeley) 4/16/94";
#define DEFLINE 1000 /* Default num lines per file. */
-long bytecnt; /* Byte count to split on. */
+size_t bytecnt; /* Byte count to split on. */
long numlines; /* Line count to split on. */
int file_open; /* If a file open. */
int ifd = -1, ofd = -1; /* Input/output file descriptors. */
@@ -106,7 +109,7 @@ main(argc, argv)
ifd = 0;
break;
case 'b': /* Byte count. */
- if ((bytecnt = strtol(optarg, &ep, 10)) <= 0 ||
+ if ((bytecnt = strtoq(optarg, &ep, 10)) <= 0 ||
(*ep != '\0' && *ep != 'k' && *ep != 'm'))
errx(EX_USAGE,
"%s: illegal byte count", optarg);
@@ -172,8 +175,7 @@ main(argc, argv)
void
split1()
{
- long bcnt;
- int dist, len;
+ size_t bcnt, dist, len;
char *C;
for (bcnt = 0;;)
OpenPOWER on IntegriCloud