Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/makefs fix single letter parsing.



details:   https://anonhg.NetBSD.org/src/rev/8dd00cbf36f9
branches:  trunk
changeset: 784382:8dd00cbf36f9
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 27 14:07:12 2013 +0000

description:
fix single letter parsing.

diffstat:

 usr.sbin/makefs/makefs.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r ad3d0d2c34ff -r 8dd00cbf36f9 usr.sbin/makefs/makefs.c
--- a/usr.sbin/makefs/makefs.c  Sun Jan 27 12:48:56 2013 +0000
+++ b/usr.sbin/makefs/makefs.c  Sun Jan 27 14:07:12 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: makefs.c,v 1.39 2013/01/24 01:10:47 christos Exp $     */
+/*     $NetBSD: makefs.c,v 1.40 2013/01/27 14:07:12 christos Exp $     */
 
 /*
  * Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: makefs.c,v 1.39 2013/01/24 01:10:47 christos Exp $");
+__RCSID("$NetBSD: makefs.c,v 1.40 2013/01/27 14:07:12 christos Exp $");
 #endif /* !__lint */
 
 #include <assert.h>
@@ -336,9 +336,10 @@
     options[i].minimum, options[i].maximum); break
 
        for (i = 0; options[i].name != NULL; i++) {
-               if (options[i].letter != var[0] && var[1] == '\0')
-                       continue;
-               else if (strcmp(options[i].name, var) != 0)
+               if (var[1] == '\0') {
+                       if (options[i].letter != var[0])
+                               continue;
+               } else if (strcmp(options[i].name, var) != 0)
                        continue;
                switch (options[i].type) {
                case OPT_BOOL:



Home | Main Index | Thread Index | Old Index