split.c (3f5869d0b05367d93cf1523c05f6ddbf1e78f845) | split.c (3e4228c3be79a29055ab1143cbc5666078a3771f) |
---|---|
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 --- 128 unchanged lines hidden (view full) --- 137 default: 138 usage(); 139 } 140 argv += optind; 141 argc -= optind; 142 143 if (*argv != NULL) 144 if (ifd == -1) { /* Input file. */ | 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 --- 128 unchanged lines hidden (view full) --- 137 default: 138 usage(); 139 } 140 argv += optind; 141 argc -= optind; 142 143 if (*argv != NULL) 144 if (ifd == -1) { /* Input file. */ |
145 if ((ifd = open(*argv, O_RDONLY, 0)) < 0) | 145 if (strcmp(*argv, "-") == 0) 146 ifd = STDIN_FILENO; 147 else if ((ifd = open(*argv, O_RDONLY, 0)) < 0) |
146 err(EX_NOINPUT, "%s", *argv); 147 ++argv; 148 } 149 if (*argv != NULL) /* File name prefix. */ 150 if (strlcpy(fname, *argv++, sizeof(fname)) >= sizeof(fname)) 151 errx(EX_USAGE, "file name prefix is too long"); 152 if (*argv != NULL) 153 usage(); --- 188 unchanged lines hidden --- | 148 err(EX_NOINPUT, "%s", *argv); 149 ++argv; 150 } 151 if (*argv != NULL) /* File name prefix. */ 152 if (strlcpy(fname, *argv++, sizeof(fname)) >= sizeof(fname)) 153 errx(EX_USAGE, "file name prefix is too long"); 154 if (*argv != NULL) 155 usage(); --- 188 unchanged lines hidden --- |