Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-05-29 11:54:45 +0400
committerCorinna Vinschen <corinna@vinschen.de>2007-05-29 11:54:45 +0400
commitdf1841c3106c0b5e475fcb22714f0f14d4120d67 (patch)
tree85568386e90a540695cc41f9ee2f84b960638d9f /winsup
parent76a2ee78b6840b23c54cf9239027014e06ae3818 (diff)
* cygpath.cc (do_options): Allow outputflag combined with other
basic flags. Only check options_from_file_flag if reading options from command line. (main): Check for NULL argz vector. Don't free argz vector prematurely. Don't force flag combination in !options_from_file_flag case.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/utils/ChangeLog8
-rw-r--r--winsup/utils/cygpath.cc16
2 files changed, 15 insertions, 9 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 6306a88cf..f92c0d7c7 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,11 @@
+2007-05-29 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygpath.cc (do_options): Allow outputflag combined with other
+ basic flags. Only check options_from_file_flag if reading options
+ from command line.
+ (main): Check for NULL argz vector. Don't free argz vector prematurely.
+ Don't force flag combination in !options_from_file_flag case.
+
2007-05-23 Corinna Vinschen <corinna@vinschen.de>
* cygpath.cc: Include argz.h.
diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc
index e49efff22..1f4588da9 100644
--- a/winsup/utils/cygpath.cc
+++ b/winsup/utils/cygpath.cc
@@ -894,12 +894,12 @@ do_options (int argc, char **argv, int from_file)
}
/* If none of the "important" flags are set, -u is default. */
- if (!unix_flag && !windows_flag && !options_from_file_flag && !output_flag
- && !mode_flag)
+ if (!unix_flag && !windows_flag && !mode_flag
+ && (!from_file ? !options_from_file_flag : 1))
unix_flag = 1;
/* Only one of ... */
- if (unix_flag + windows_flag + output_flag + mode_flag > 1
+ if (unix_flag + windows_flag + mode_flag > 1
+ (!from_file ? options_from_file_flag : 0))
usage (stderr, 1);
@@ -994,6 +994,8 @@ main (int argc, char **argv)
perror ("cygpath");
exit (1);
}
+ if (!az)
+ continue;
ac = argz_count (az, azl) + 1;
av = (char **) malloc ((ac + 1) * sizeof (char *));
if (!av)
@@ -1003,16 +1005,12 @@ main (int argc, char **argv)
}
av[0] = prog_name;
argz_extract (az, azl, av + 1);
- free (az);
if (options_from_file_flag)
o = do_options (ac, av, 1);
else
- {
- optind = 1;
- unix_flag = 1;
- output_flag = mode_flag = windows_flag = 0;
- }
+ optind = 1;
action (ac, av, o);
+ free (az);
free (av);
}
}