split.c (131978) | split.c (149345) |
---|---|
1/* 2 * Copyright (c) 1987, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1987, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/usr.bin/split/split.c 131978 2004-07-11 14:44:23Z tjr $"); | 35__FBSDID("$FreeBSD: head/usr.bin/split/split.c 149345 2005-08-21 06:35:02Z tjr $"); |
36 37#ifndef lint 38static const char copyright[] = 39"@(#) Copyright (c) 1987, 1993, 1994\n\ 40 The Regents of the University of California. All rights reserved.\n"; 41#endif 42 43#ifndef lint --- 270 unchanged lines hidden (view full) --- 314 ofd = fileno(stdout); 315 } 316 317 /* maxfiles = 26^sufflen, but don't use libm. */ 318 for (maxfiles = 1, i = 0; i < sufflen; i++) 319 if ((maxfiles *= 26) <= 0) 320 errx(EX_USAGE, "suffix is too long (max %ld)", i); 321 | 36 37#ifndef lint 38static const char copyright[] = 39"@(#) Copyright (c) 1987, 1993, 1994\n\ 40 The Regents of the University of California. All rights reserved.\n"; 41#endif 42 43#ifndef lint --- 270 unchanged lines hidden (view full) --- 314 ofd = fileno(stdout); 315 } 316 317 /* maxfiles = 26^sufflen, but don't use libm. */ 318 for (maxfiles = 1, i = 0; i < sufflen; i++) 319 if ((maxfiles *= 26) <= 0) 320 errx(EX_USAGE, "suffix is too long (max %ld)", i); 321 |
322 /* 323 * Hack to increase max files; original code wandered through 324 * magic characters. 325 */ 326 if (fnum == maxfiles) { 327 if (!defname || fname[0] == 'z') 328 errx(EX_DATAERR, "too many files"); 329 ++fname[0]; 330 fnum = 0; 331 } | 322 if (fnum == maxfiles) 323 errx(EX_DATAERR, "too many files"); |
332 333 /* Generate suffix of sufflen letters */ 334 tfnum = fnum; 335 i = sufflen - 1; 336 do { 337 fpnt[i] = tfnum % 26 + 'a'; 338 tfnum /= 26; 339 } while (i-- > 0); --- 17 unchanged lines hidden --- | 324 325 /* Generate suffix of sufflen letters */ 326 tfnum = fnum; 327 i = sufflen - 1; 328 do { 329 fpnt[i] = tfnum % 26 + 'a'; 330 tfnum /= 26; 331 } while (i-- > 0); --- 17 unchanged lines hidden --- |