Follow the changes to fix issue #1643 from TortoiseSVN

Based on TortoiseSVN revision 24379

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
Trim trailing space

Based on TortoiseSVN revision 24384

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>