Description:
i used to build a minimal static sh for root resque tasks. after
update to v 2.05b i am unable to do it off the box anymore. the problem
is that some fields in the COMMAND structure undef'ed in that case while
executing_line_number() still uses them unconditionally.
Repeat-By:
CFLAGS="-Os" ./configure --enable-minimal-shell && make
Fix:
wrap lines in question with defines (tiny patch attached)
diff -Nur bash-2.05b.orig/execute_cmd.c bash-2.05b/execute_cmd.c
--- bash-2.05b.orig/execute_cmd.c Mon Mar 18 21:24:22 2002
+++ bash-2.05b/execute_cmd.c Mon Sep 9 21:44:38 2002
@@ -286,12 +290,18 @@
{
if (currently_executing_command->type == cm_simple)
return currently_executing_command->value.Simple->line;
+#if defined (COND_COMMAND)
else if (currently_executing_command->type == cm_cond)
return currently_executing_command->value.Cond->line;
+#endif
+#if defined (DPAREN_ARITHMETIC)
else if (currently_executing_command->type == cm_arith)
return currently_executing_command->value.Arith->line;
+#endif
+#if defined (ARITH_FOR_COMMAND)
else if (currently_executing_command->type == cm_arith_for)
return currently_executing_command->value.ArithFor->line;
+#endif
else
return line_number;
}