mxcl/homebrew — pull request #24806 by mernen (2013-11-30 16:45:54+00:00)
Title: bash: add missing braces to patch, fixing `\W`

Issue #23470 brought a patch for Bash that fixes a crash, while introducing incorrect behavior for the `\W` sequence in prompts.

According to the [Bash Reference Manual](http://www.gnu.org/software/bash/manual/bashref.html):

> `\W`
> The basename of `$PWD`, with `$HOME` abbreviated with a tilde.

## Simple test

$ PS1='\W $ '
~ $ cd Documents
/Users/mernen/Documents $

The last line should show just "Documents $".

## Cause

In short, that patch did this:

else
- strcpy(t_string, polite_directory_format(t_string));
+ temp = polite_directory_format(t_string);
+ if (temp != t_string)
+ strcpy(t_string, temp);

See it? One statement being replaced by two statements on an unbracketed `else`!

This patch adds the missing brackets.