split.c (0742d4ed1a69d3a99cc4b790405bd95840dfb2e5) split.c (e93586df9d2139aa4082b26e077a5fd802b67a5a)
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

--- 305 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
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

--- 305 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 ---