It looks like g_fopen() in the version of GLib that we ship with Windows

sets errno to 0 when we can't open a file.  This resurrected the annoying
"C:\Program Files\Ethereal\asn1/default.tt" error in the ASN.1 plugin,
since we depended on errno being set to ENOENT.  Move some logic around
to account for this.

svn path=/trunk/; revision=18073
This commit is contained in:
Gerald Combs 2006-05-02 18:21:42 +00:00
parent 25bead5edf
commit c23899620f
1 changed files with 3 additions and 4 deletions

View File

@ -2753,12 +2753,11 @@ read_asn1_type_table(const char *filename)
* had a "/" rather than a "\" as the last pathname
* separator.
*/
if ((strcmp(filename, old_default_asn1_filename) != 0
#ifdef _WIN32
&& strcmp(filename, bad_separator_old_default_asn1_filename) != 0
if (strcmp(filename, bad_separator_old_default_asn1_filename) != 0)
#endif
) || errno != ENOENT)
report_open_failure(filename, errno, FALSE);
if ((strcmp(filename, old_default_asn1_filename) != 0) || errno != ENOENT)
report_open_failure(filename, errno, FALSE);
return;
}
fstat(fileno(f), &stat);