diff options
author | Jari Aalto <jari.aalto@cante.net> | 2000-03-17 21:46:59 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:53 +0000 |
commit | bb70624e964126b7ac4ff085ba163a9c35ffa18f (patch) | |
tree | ba2dd4add13ada94b1899c6d4aca80195b80b74b /builtins/set.def | |
parent | b72432fdcc59300c6fe7c9d6c8a31ad3447933f5 (diff) | |
download | bash-bb70624e964126b7ac4ff085ba163a9c35ffa18f.tar.gz |
Imported from ../bash-2.04.tar.gz.
Diffstat (limited to 'builtins/set.def')
-rw-r--r-- | builtins/set.def | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/builtins/set.def b/builtins/set.def index 423a0671..fd7dc993 100644 --- a/builtins/set.def +++ b/builtins/set.def @@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell. Bash is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 1, or (at your option) any later +Software Foundation; either version 2, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY @@ -17,7 +17,7 @@ for more details. You should have received a copy of the GNU General Public License along with Bash; see the file COPYING. If not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. $PRODUCES set.c @@ -266,6 +266,23 @@ list_minus_o_opts (mode, reusable) } } +char ** +get_minus_o_opts () +{ + char **ret; + int n, i, ind; + + n = (sizeof (o_options) / sizeof (o_options[0])) + + (sizeof (binary_o_options) / sizeof (binary_o_options[0])); + ret = alloc_array (n + 1); + for (i = ind = 0; o_options[i].name; i++) + ret[ind++] = o_options[i].name; + for (i = 0; binary_o_options[i].name; i++) + ret[ind++] = binary_o_options[i].name; + ret[ind] = (char *)NULL; + return ret; +} + static int set_ignoreeof (on_or_off, option_name) int on_or_off; @@ -457,7 +474,7 @@ set_shellopts () note whether or not the variable was exported. */ if (v) { - v->attributes &= ~att_readonly; + VUNSETATTR (v, att_readonly); exported = exported_p (v); } else @@ -468,9 +485,9 @@ set_shellopts () /* Turn the read-only attribute back on, and turn off the export attribute if it was set implicitly by mark_modified_vars and SHELLOPTS was not exported before we bound the new value. */ - v->attributes |= att_readonly; + VSETATTR (v, att_readonly); if (mark_modified_vars && exported == 0 && exported_p (v)) - v->attributes &= ~att_exported; + VUNSETATTR (v, att_exported); free (value); } |