Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/mkdep Backing this out until it works.



details:   https://anonhg.NetBSD.org/src/rev/8685e11834c4
branches:  trunk
changeset: 541840:8685e11834c4
user:      elric <elric%NetBSD.org@localhost>
date:      Sun Jan 19 00:42:45 2003 +0000

description:
Backing this out until it works.

diffstat:

 usr.bin/mkdep/mkdep.c |  38 ++++++++++++++++----------------------
 1 files changed, 16 insertions(+), 22 deletions(-)

diffs (71 lines):

diff -r 9e07c0e8c4ce -r 8685e11834c4 usr.bin/mkdep/mkdep.c
--- a/usr.bin/mkdep/mkdep.c     Sun Jan 19 00:42:24 2003 +0000
+++ b/usr.bin/mkdep/mkdep.c     Sun Jan 19 00:42:45 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkdep.c,v 1.14 2003/01/18 22:32:20 jmmv Exp $ */
+/* $NetBSD: mkdep.c,v 1.15 2003/01/19 00:42:45 elric Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 #endif /* not lint */
 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mkdep.c,v 1.14 2003/01/18 22:32:20 jmmv Exp $");
+__RCSID("$NetBSD: mkdep.c,v 1.15 2003/01/19 00:42:45 elric Exp $");
 #endif /* not lint */
 
 #if HAVE_CONFIG_H
@@ -100,7 +100,8 @@
        int     argc;
        char  **argv;
 {
-       int     aflag, pflag, ch, status;
+       /* LINTED local definition of index */
+       int     aflag, pflag, index, status;
        pid_t   cpid, pid;
        char   *filename, *CC, *pathname, **args;
        const char *tmpdir;
@@ -115,30 +116,23 @@
        pflag = 0;
        filename = DEFAULT_FILENAME;
 
-       opterr = 0;
-       while ((ch = getopt(argc, argv, "af:p")) != -1) {
-               switch (ch) {
-               case 'a':
+       /* XXX should use getopt(). */
+       for (index = 1; index < argc; index++) {
+               if (strcmp(argv[index], "-a") == 0)
                        aflag = 1;
-                       break;
-               case 'f':
-                       filename = optarg;
-                       break;
-               case 'p':
+               else if (strcmp(argv[index], "-f") == 0) {
+                       if (++index < argc)
+                               filename = argv[index];
+               } else if (strcmp(argv[index], "-p") == 0)
                        pflag = 1;
+               else
                        break;
-               default:
-                       /* We need to ignore unknown options, as they may
-                        * be cc related. */
-                       break;
-               }
        }
-       argc -= optind;
-       argv += optind;
-       if (argc == 0) {
+
+       argc -= index;
+       argv += index;
+       if (argc == 0)
                usage();
-               /* NOTREACHED */
-       }
 
        if ((CC = getenv("CC")) == NULL)
                CC = DEFAULT_CC;



Home | Main Index | Thread Index | Old Index