]> andersk Git - openssh.git/commitdiff
- (djm) OpenBSD CVS Sync
authordjm <djm>
Sun, 29 Jun 2008 12:45:13 +0000 (12:45 +0000)
committerdjm <djm>
Sun, 29 Jun 2008 12:45:13 +0000 (12:45 +0000)
   - martynas@cvs.openbsd.org 2008/06/21 07:46:46
     [sftp.c]
     use optopt to get invalid flag, instead of return value of getopt,
     which is always '?';  ok djm@

ChangeLog
sftp.c

index a09bf8e24a7668c1080bb99830367a39695d35bf..12cd13d99edcba77872e8086fbe3f8c94cf30cfc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+20080629
+ - (djm) OpenBSD CVS Sync
+   - martynas@cvs.openbsd.org 2008/06/21 07:46:46
+     [sftp.c]
+     use optopt to get invalid flag, instead of return value of getopt,
+     which is always '?';  ok djm@
+
 20080628
  - (djm) [RFC.nroff contrib/cygwin/Makefile contrib/suse/openssh.spec]
    RFC.nroff lacks a license, remove it (it is long gone in OpenBSD).
diff --git a/sftp.c b/sftp.c
index 9b8bf389c51e8737f3ed1b7d77e5e2c01f5a66e1..f361378ee901f09df5872d4f16dca15b6aa0fac7 100644 (file)
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.101 2008/06/08 20:15:29 dtucker Exp $ */
+/* $OpenBSD: sftp.c,v 1.102 2008/06/21 07:46:46 martynas Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
  *
@@ -364,7 +364,7 @@ infer_path(const char *p, char **ifp)
 static int
 parse_getput_flags(const char *cmd, char **argv, int argc, int *pflag)
 {
-       extern int optind, optreset, opterr;
+       extern int opterr, optind, optopt, optreset;
        int ch;
 
        optind = optreset = 1;
@@ -378,7 +378,7 @@ parse_getput_flags(const char *cmd, char **argv, int argc, int *pflag)
                        *pflag = 1;
                        break;
                default:
-                       error("%s: Invalid flag -%c", cmd, ch);
+                       error("%s: Invalid flag -%c", cmd, optopt);
                        return -1;
                }
        }
@@ -389,7 +389,7 @@ parse_getput_flags(const char *cmd, char **argv, int argc, int *pflag)
 static int
 parse_ls_flags(char **argv, int argc, int *lflag)
 {
-       extern int optind, optreset, opterr;
+       extern int opterr, optind, optopt, optreset;
        int ch;
 
        optind = optreset = 1;
@@ -428,7 +428,7 @@ parse_ls_flags(char **argv, int argc, int *lflag)
                        *lflag |= LS_TIME_SORT;
                        break;
                default:
-                       error("ls: Invalid flag -%c", ch);
+                       error("ls: Invalid flag -%c", optopt);
                        return -1;
                }
        }
@@ -439,7 +439,7 @@ parse_ls_flags(char **argv, int argc, int *lflag)
 static int
 parse_df_flags(const char *cmd, char **argv, int argc, int *hflag, int *iflag)
 {
-       extern int optind, optreset, opterr;
+       extern int opterr, optind, optopt, optreset;
        int ch;
 
        optind = optreset = 1;
@@ -455,7 +455,7 @@ parse_df_flags(const char *cmd, char **argv, int argc, int *hflag, int *iflag)
                        *iflag = 1;
                        break;
                default:
-                       error("%s: Invalid flag -%c", cmd, ch);
+                       error("%s: Invalid flag -%c", cmd, optopt);
                        return -1;
                }
        }
This page took 0.18803 seconds and 5 git commands to generate.