extern int interactive;
extern int noclobber, posixly_correct, ignoreeof, eof_encountered_limit;
#if defined (READLINE)
-extern int rl_editing_mode, no_line_editing;
+extern int no_line_editing;
#endif /* READLINE */
$BUILTIN set
for (i = 0; binary_o_options[i].name; i++)
{
if (STREQ (name, binary_o_options[i].name))
- return (GET_BINARY_O_OPTION_VALUE (i, name));
+ return (GET_BINARY_O_OPTION_VALUE (i, name));
}
-
+
return (-1);
}
if (on_or_off == FLAG_UNKNOWN)
on_or_off = &value;
if (mode == -1 || mode == *on_or_off)
- print_minus_o_option (o_options[i].name, *on_or_off, reusable);
+ print_minus_o_option (o_options[i].name, *on_or_off, reusable);
}
for (i = 0; binary_o_options[i].name; i++)
{
value = GET_BINARY_O_OPTION_VALUE (i, binary_o_options[i].name);
if (mode == -1 || mode == value)
- print_minus_o_option (binary_o_options[i].name, value, reusable);
+ print_minus_o_option (binary_o_options[i].name, value, reusable);
}
}
for (i = 0, option_char = -1, set_func = 0; o_options[i].name; i++)
{
if (STREQ (option_name, o_options[i].name))
- {
- option_char = o_options[i].letter;
- break;
- }
+ {
+ option_char = o_options[i].letter;
+ break;
+ }
}
if (option_char == -1)
{
free (vars);
}
- vars = all_shell_functions ();
- if (vars)
+ /* POSIX.2 does not allow function names and definitions to be output when
+ `set' is invoked without options (PASC Interp #202). */
+ if (posixly_correct == 0)
{
- print_var_list (vars);
- free (vars);
+ vars = all_shell_functions ();
+ if (vars)
+ {
+ print_func_list (vars);
+ free (vars);
+ }
}
}
set_shellopts ();
}
-/* Reset the values of the -o options that are not also shell flags. */
+/* Reset the values of the -o options that are not also shell flags. This is
+ called from execute_cmd.c:initialize_subshell() when setting up a subshell
+ to run an executable shell script without a leading `#!'. */
void
reset_shell_options ()
{
#if defined (HISTORY)
remember_on_history = 1;
#endif
- ignoreeof = posixly_correct = 0;
+ ignoreeof = 0;
}
/* Set some flags from the word values in the input list. If LIST is empty,
the `-v', unset will only act on variables. Given the `-f' flag,
unset will only act on functions. With neither flag, unset first
tries to unset a variable, and if that fails, then tries to unset a
-function. Some variables (such as PATH and IFS) cannot be unset; also
-see readonly.
+function. Some variables cannot be unset; also see readonly.
$END
#define NEXT_VARIABLE() any_failed++; list = list->next; continue;
to be created when not in posix mode, so check only when in posix
mode when unsetting a function. */
if (((unset_function && posixly_correct) || !unset_function) && legal_identifier (name) == 0)
- {
- builtin_error ("`%s': not a valid identifier", name);
- NEXT_VARIABLE ();
- }
+ {
+ builtin_error ("`%s': not a valid identifier", name);
+ NEXT_VARIABLE ();
+ }
var = unset_function ? find_function (name) : find_variable (name);