The attached patch fixes a segmentation fault that occurs when a GDB script has an empty else clause. E.g. if $cond echo here\n else # boom end The command structure is apparently read correctly (from the user's perspective), but GDB will crash when it tries to a) execute the else clause ($cond == 0), or b) free the command, if the command is not in a define or the user-defined command is redefined. This problem is caused by a pointer that is only initialised when it is first used, which is never when there are no commands. :ADDPATCH CLI: Andrew Stubbs