From c6f59f7abe4e89f690021c2ba29dfef8a3cc7a9c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 14 Feb 1994 21:19:12 +0000 Subject: [PATCH] . --- old/sh-utils/ChangeLog | 36 ++++++++++++++++++++++++++++++++++++ old/sh-utils/NEWS | 6 ++++++ src/basename.c | 6 +++++- src/dirname.c | 6 +++++- src/stty.c | 6 +++++- 5 files changed, 57 insertions(+), 3 deletions(-) diff --git a/old/sh-utils/ChangeLog b/old/sh-utils/ChangeLog index f825560..1df78dd 100644 --- a/old/sh-utils/ChangeLog +++ b/old/sh-utils/ChangeLog @@ -1,3 +1,39 @@ +Sun Feb 13 13:34:25 1994 Jim Meyering (meyering@comco.com) + + * basename.1, dirname.1, stty.1: Reflect usage changes. + * basename.c, dirname.c, stty.c (usage): Ditto. + + * long-options.h (parse_long_options): Invoke usage function + argument with explicit dereference as per GNU coding standards. + + * basename.c dirname.c: Use parse_long_options instead of the + conventional getopt_long paradigm. Before, the commands + `basename file-dist -dist' and `basename -- file.c .c' produced + incorrect results. Now, even `basename -file-dist -dist' works + and the command `basename -- file.c .c' fails for the right + reason: the `--' is not a special (to getopt) token for these + commands. It is interpreted as the filename, so there are too + many arguments to basename. Rick Sladkey + reported the problem with basename. + + * stty.c (set_window_size): When stty fails to get the window size + (as happens on telnet sessions to Solaris systems), initialize all + fields of the winsize struct. Before, it was using the uninitialized + pixel fields of the struct in the ioctl to set window size parameters. + From Rick Sladkey. + + * stty.c (main): Use parse_long_options to handle --help and --version. + (main): In the remaining getopt_long loop, don't jump out of the + loop from the `default' branch of the switch statement. Doing that + left optind in an inconsistent when there were non-option arguments + preceding `reversed' arguments (e.g. stty echo -echoe) and the + preceding non-option arguments were ignored. Rick Sladkey reported + that stty was ignoring arguments. + + * stty.c (main): Fail with a diagnostic when both -g and -a are given. + (main): Fail with a diagnostic when either -g or -a is used with + arguments for setting modes. + Fri Feb 11 19:39:37 1994 Jim Meyering (meyering@comco.com) * stty.c (get_win_size): Don't use an ANSI-style function diff --git a/old/sh-utils/NEWS b/old/sh-utils/NEWS index 70292f8..90958f3 100644 --- a/old/sh-utils/NEWS +++ b/old/sh-utils/NEWS @@ -1,4 +1,10 @@ User visible changes in release 1.9.3 +* `stty -a -g' gets a diagnostic +* `stty {-a|-g} any-other-argument' gets a diagnostic +* stty no longer ignores some of its arguments +* basename and dirname no longer treat `--' specially +* `basename -- file.c .c' generates a usage error. Before, it output `file'. +* `basename file-dist -dist' outputs `file'. Before it output `file-dist'. * stty defaults `swtch' to undefined for Solaris so `susp' (^Z) will work. Before, with the default settings ^Z did nothing. * stty no longer gives an error message when it finds a spurious difference diff --git a/src/basename.c b/src/basename.c index 6fc1130..8f773e9 100644 --- a/src/basename.c +++ b/src/basename.c @@ -59,7 +59,11 @@ usage (status) program_name); else { - printf ("Usage: %s [OPTION]... PATH [SUFFIX]\n", program_name); + printf ("\ +Usage: %s PATH [SUFFIX]\n\ + or: %s OPTION\n\ +", + program_name, program_name); printf ("\ \n\ --help display this help and exit\n\ diff --git a/src/dirname.c b/src/dirname.c index a0345be..17beaba 100644 --- a/src/dirname.c +++ b/src/dirname.c @@ -48,7 +48,11 @@ usage (status) program_name); else { - printf ("Usage: %s [OPTION]... PATH\n", program_name); + printf ("\ +Usage: %s PATH\n\ + or: %s OPTION\n\ +", + program_name, program_name); printf ("\ \n\ --help display this help and exit\n\ diff --git a/src/stty.c b/src/stty.c index 5b3f7f4..b094f8b 100644 --- a/src/stty.c +++ b/src/stty.c @@ -452,7 +452,11 @@ usage (status) program_name); else { - printf ("Usage: %s [OPTION]... [SETTING]...\n", program_name); + printf ("\ +Usage: %s [SETTING]...\n\ + or: %s OPTION\n\ +", + program_name, program_name); printf ("\ \n\ -a, --all print all current settings in human-readable form\n\ -- 2.7.4