mirror of
https://github.com/sheumann/hush.git
synced 2024-12-26 10:32:02 +00:00
last_patch41 from vodz to fix stty -F and similar
This commit is contained in:
parent
ff7661d9de
commit
fc059090b6
@ -572,14 +572,34 @@ extern int main(int argc, char **argv)
|
||||
|
||||
speed_was_set = 0;
|
||||
require_set_attr = 0;
|
||||
k = optind;
|
||||
while (k < argc) {
|
||||
k = 0;
|
||||
while (++k < argc) {
|
||||
int match_found = 0;
|
||||
int reversed = 0;
|
||||
int i;
|
||||
|
||||
if (argv[k][0] == '-') {
|
||||
char *find_dev_opt;
|
||||
|
||||
++argv[k];
|
||||
|
||||
/* Handle "-a", "-ag", "-aF/dev/foo", "-aF /dev/foo", etc.
|
||||
Find the options that have been parsed. This is really
|
||||
gross, but it's needed because stty SETTINGS look like options to
|
||||
getopt(), so we need to work around things in a really horrible
|
||||
way. If any new options are ever added to stty, the short option
|
||||
MUST NOT be a letter which is the first letter of one of the
|
||||
possible stty settings.
|
||||
*/
|
||||
find_dev_opt = strchr(argv[k], 'F'); /* find -*F* */
|
||||
if(find_dev_opt) {
|
||||
if(find_dev_opt[1]==0) /* -*F /dev/foo */
|
||||
k++; /* skip /dev/foo */
|
||||
continue; /* else -*F/dev/foo - no skip */
|
||||
}
|
||||
if(argv[k][0]=='a' || argv[k][0]=='g')
|
||||
continue;
|
||||
/* Is not options - is reverse params */
|
||||
reversed = 1;
|
||||
}
|
||||
for (i = 0; i < NUM_mode_info; ++i)
|
||||
@ -661,7 +681,6 @@ extern int main(int argc, char **argv)
|
||||
} else
|
||||
error_msg_and_die("invalid argument `%s'", argv[k]);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
|
||||
if (require_set_attr) {
|
||||
|
Loading…
Reference in New Issue
Block a user