Commit ea33a634 authored by Morten Welinder's avatar Morten Welinder
Browse files

Handle empty csv files sanely.

parent 9ae309b9
......@@ -2,6 +2,7 @@
* src/stf.c (csv_tsv_probe): Fix a pile of content-probe issues.
Fixes #318419.
Handle empty csv files sanely.
2005-10-10 Jody Goldberg <jody@gnome.org>
......
......@@ -2,6 +2,7 @@
* src/stf.c (csv_tsv_probe): Fix a pile of content-probe issues.
Fixes #318419.
Handle empty csv files sanely.
2005-10-10 Jody Goldberg <jody@gnome.org>
......
......@@ -460,6 +460,12 @@ csv_tsv_probe (GOFileOpener const *fo, GsfInput *input, FileProbeLevel pl)
if (gsf_input_seek (input, 0, G_SEEK_SET))
return FALSE;
i = gsf_input_remaining (input);
/* If someone ship us an empty file, accept it only if
it has a proper name. */
if (i == 0)
return csv_tsv_probe (fo, input, FILE_PROBE_FILE_NAME);
if (i > N) i = N;
if (NULL == (header = gsf_input_read (input, i, NULL)))
return FALSE;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment