From 946564c3f6c751d9f0efa0871d0dcabb7300b309 Mon Sep 17 00:00:00 2001 From: bjh21 Date: Thu, 26 Jun 2003 23:06:52 +0000 Subject: Remove support for treating "-" as an option rather than an operand. The practical consequence of this is that "-" is treated the same as a file name, and can't have options specified after it. This is consistent with other utilities and with POSIX. --- usr.bin/split/split.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'usr.bin/split') diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c index 98d7d827591..58bb1acc737 100644 --- a/usr.bin/split/split.c +++ b/usr.bin/split/split.c @@ -1,4 +1,4 @@ -/* $NetBSD: split.c,v 1.14 2003/06/26 22:49:53 bjh21 Exp $ */ +/* $NetBSD: split.c,v 1.15 2003/06/26 23:06:52 bjh21 Exp $ */ /* * Copyright (c) 1987, 1993, 1994 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)split.c 8.3 (Berkeley) 4/25/94"; #endif -__RCSID("$NetBSD: split.c,v 1.14 2003/06/26 22:49:53 bjh21 Exp $"); +__RCSID("$NetBSD: split.c,v 1.15 2003/06/26 23:06:52 bjh21 Exp $"); #endif /* not lint */ #include @@ -81,7 +81,7 @@ main(int argc, char *argv[]) size_t namelen; long name_max; - while ((ch = getopt(argc, argv, "-0123456789b:l:a:")) != -1) + while ((ch = getopt(argc, argv, "0123456789b:l:a:")) != -1) switch (ch) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -100,11 +100,6 @@ main(int argc, char *argv[]) errx(1, "%s: illegal line count.", p); } break; - case '-': /* stdin flag. */ - if (ifd != -1) - usage(); - ifd = 0; - break; case 'b': /* Byte count. */ if (!isdigit((unsigned char)optarg[0]) || (bytecnt = strtoull(optarg, &ep, 10)) == 0 || @@ -135,14 +130,13 @@ main(int argc, char *argv[]) argv += optind; argc -= optind; - if (*argv != NULL) - if (ifd == -1) { /* Input file. */ - if (strcmp(*argv, "-") == 0) - ifd = STDIN_FILENO; - else if ((ifd = open(*argv, O_RDONLY, 0)) < 0) - err(1, "%s", *argv); - ++argv; - } + if (*argv != NULL) { + if (strcmp(*argv, "-") == 0) + ifd = STDIN_FILENO; + else if ((ifd = open(*argv, O_RDONLY, 0)) < 0) + err(1, "%s", *argv); + ++argv; + } errno = 0; if ((name_max = pathconf(".", _PC_NAME_MAX)) == -1 && -- cgit =1'>Expand)Author 2012-07-27Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MDmatt 2011-04-13install <machine/intr.h> for crash(8).mrg 2010-05-24Make C declarations match assembler reality: ipi functions get two argumentsmartin 2010-03-06clean up a bunch of MULTIPROCESSOR:mrg 2010-02-01- add a PDB_CTX_FLUSHALL debug type to pmap.c, and also log the cpu_number()mrg 2009-11-30sparc64_ipi_flush_ctx and sparc64_ipi_flush_all have been removed,nakayama 2008-04-28Remove clause 3 and 4 from TNF licensesmartin 2008-04-22#include "opt_multiprocessor.h"nakayama 2008-04-14Remove sparc64_ipi_sync_tick.nakayama 2008-03-14Improve IPI handling:nakayama 2008-03-02Make ddb's "mach cpu" command do the right thing: run ddb on the requestedmartin 2008-01-15Rename cpuset_t for now to sparc64_cpuset_t, to avoid a name clash withmartin 2007-12-03Interrupt handling changes, in discussion since February:ad 2007-10-17Merge the ppcoea-renovation branch to HEAD.garbled 2007-05-17merge yamt-idlelwp branch. asked by core@. some ports still needs work.yamt 2006-10-06Initial support for floppy drives on sparc64. This has been testedjnemeth 2006-09-18Lazy FPU handling for the MULTIPROCESSOR casemartin 2006-09-13SMP cleanup. provide support for multiple CPUs in DDB. (SMP itselfmrg 2006-05-04pull splraiseipl() for sparc64 from newlock branch.yamt 2005-12-11merge ktrace-lwp.christos 2004-05-20De-_P()fy, remove not MULTIPROCESSOR defines for sparc64_ipi_xxx.petrov 2004-03-14checkpoint of MP work from dennis and myself. includes cross-processorchs 2003-06-16Rename IPL_IMP -> IPL_VM.thorpej