bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] build: fix build of variables.c


From: Eric Blake
Subject: [PATCH] build: fix build of variables.c
Date: Fri, 17 Apr 2015 08:26:04 -0600

gcc  -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"linux-gnu"' 
-DCONF_MACHTYPE='"x86_64-unknown-linux-gnu"' -DCONF_VENDOR='"unknown"' 
-DLOCALEDIR='"/usr/local/share/locale"' -DPACKAGE='"bash"' -DSHELL 
-DHAVE_CONFIG_H -DDEBUG -DMALLOC_DEBUG -I.  -I. -I./include -I./lib   -g -O2 
-Wno-parentheses -Wno-format-security -c variables.c
variables.c: In function ‘initialize_shell_variables’:
variables.c:425:7: error: ‘else’ without a previous ‘if’
       else
              ^

* variables.c: Group 'else' with #ifdef'd 'if'.

Signed-off-by: Eric Blake <address@hidden>
---

The current 'devel' branch of bash.git failed to build for me
without this patch.

 variables.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/variables.c b/variables.c
index c992410..513a0c5 100644
--- a/variables.c
+++ b/variables.c
@@ -407,11 +407,12 @@ initialize_shell_variables (env, privmode)
          /* Restore original suffix */
          tname[namelen] = BASHFUNC_SUFFIX[0];
        }
+      else
 #endif /* FUNCTION_IMPORT */
 #if defined (ARRAY_VARS)
 #  if ARRAY_EXPORT
       /* Array variables may not yet be exported. */
-      else if (*string == '(' && string[1] == '[' && string[strlen (string) - 
1] == ')')
+      if (*string == '(' && string[1] == '[' && string[strlen (string) - 1] == 
')')
        {
          string_length = 1;
          temp_string = extract_array_assignment_list (string, &string_length);
@@ -420,9 +421,9 @@ initialize_shell_variables (env, privmode)
          VSETATTR (temp_var, (att_exported | att_imported));
          array_needs_making = 1;
        }
+      else
 #  endif /* ARRAY_EXPORT */
 #endif
-      else
        {
          ro = 0;
          if (posixly_correct && STREQ (name, "SHELLOPTS"))
-- 
2.1.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]