Comment 13 for bug 43977

Revision history for this message
Gary Coady (garycoady) wrote : Updated patch

The previous patch would be confusing to anybody reading it :-)

The intent of the original (unpatched) code
if (value[last_char_index] == ';')
   value[last_char_index] = '\0';

was to remove the last character of the string, if it was a semicolon.

If the string was of zero length, the previous patch I uploaded caused a comparison of '\0' against ';', which would always fail, so the patch worked. But this patch only does the test if there are any characters to actually look at.