bug-bash
[Top][All Lists]
Advanced

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

bash 2.05b: missing ifdefs in execute_cmd.c


From: Michael Zwettler
Subject: bash 2.05b: missing ifdefs in execute_cmd.c
Date: Mon, 20 Oct 2003 20:49:56 +0200 (MEST)

Hi,

bash 2.05b doesn't compile when configured with
--enable-minimal-config:

execute_cmd.c: In function `executing_line_number':
execute_cmd.c:290: union has no member named `Cond'
execute_cmd.c:292: union has no member named `Arith'
execute_cmd.c:294: union has no member named `ArithFor'
make: *** [execute_cmd.o] Error 1


In the function executing_line_number() the COMMAND union
members Cond, Arith and ArithFor are accessed without
checking the configuration:


/* Return the line number of the currently executing command. */
int
executing_line_number ()
{
  if (executing && (variable_context == 0 || interactive_shell == 0) &&
currently_executing_command)
    {
      if (currently_executing_command->type == cm_simple)
        return currently_executing_command->value.Simple->line;
      else if (currently_executing_command->type == cm_cond)
        return currently_executing_command->value.Cond->line;
      else if (currently_executing_command->type == cm_arith)
        return currently_executing_command->value.Arith->line;
      else if (currently_executing_command->type == cm_arith_for)
        return currently_executing_command->value.ArithFor->line;
      else
        return line_number;
    }
  else if (running_trap)
    return trap_line_number;
  else
    return line_number;
}


I added the following missing #ifdefs, now it compiles (and works)
fine:


/* Return the line number of the currently executing command. */
int
executing_line_number ()
{
  if (executing && (variable_context == 0 || interactive_shell == 0) &&
currently_executing_command)
    {
      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;
    }
  else if (running_trap)
    return trap_line_number;
  else
    return line_number;
}


Hope this helps,
Michael Zwettler


-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++





reply via email to

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