X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=builtins%2Fshopt.def;h=db46c318b8a3375826dfa7b389396520ae850a57;hb=f1be666c7d78939ad775078d290bec2758fa29a2;hp=ae100ace47c2b3cd3662bccb133a708d2a94d002;hpb=0628567a28f3510f506ae46cb9b24b73a6d2dc5d;p=platform%2Fupstream%2Fbash.git diff --git a/builtins/shopt.def b/builtins/shopt.def index ae100ac..db46c31 100644 --- a/builtins/shopt.def +++ b/builtins/shopt.def @@ -101,11 +101,14 @@ static void shopt_error __P((char *)); static int set_shellopts_after_change __P((int)); +static int set_compatibility_level __P((int)); + #if defined (RESTRICTED_SHELL) static int set_restricted_shell __P((int)); #endif static int shopt_login_shell; +static int shopt_compat31; typedef int shopt_set_func_t __P((int)); @@ -121,6 +124,7 @@ static struct { #if defined (HISTORY) { "cmdhist", &command_oriented_history, (shopt_set_func_t *)NULL }, #endif + { "compat31", &shopt_compat31, set_compatibility_level }, { "dotglob", &glob_dot_filenames, (shopt_set_func_t *)NULL }, { "execfail", &no_exit_on_failed_exec, (shopt_set_func_t *)NULL }, { "expand_aliases", &expand_aliases, (shopt_set_func_t *)NULL }, @@ -459,6 +463,18 @@ set_shellopts_after_change (mode) return (0); } +static int +set_compatibility_level (mode) + int mode; +{ + /* Need to change logic here as we add more compatibility levels */ + if (shopt_compat31) + shell_compatibility_level = 31; + else + shell_compatibility_level = 32; + return 0; +} + #if defined (RESTRICTED_SHELL) /* Don't allow the value of restricted_shell to be modified. */