text_file: don't strip trailing whitespace
Only delete the newline characters (\n and optionally \r). This allows the database file to store file names with trailing whitespace.
This commit is contained in:
parent
828a5f552f
commit
02526eda86
|
@ -57,7 +57,12 @@ read_text_line(FILE *file, GString *buffer)
|
|||
g_string_set_size(buffer, length + step);
|
||||
}
|
||||
|
||||
/* remove the newline characters */
|
||||
if (buffer->str[length - 1] == '\n')
|
||||
--length;
|
||||
if (buffer->str[length - 1] == '\r')
|
||||
--length;
|
||||
|
||||
g_string_set_size(buffer, length);
|
||||
g_strchomp(buffer->str);
|
||||
return buffer->str;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue