Commit 57cbeff0 authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Federico Mena Quintero
Browse files

Fixes #136080.

2004-03-08  Federico Mena Quintero  <federico@ximian.com>

	Fixes #136080.

	* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
	ENOENT.
	(filename_get_info): Likewise.
parent 993c96ed
2004-03-08 Federico Mena Quintero <federico@ximian.com>
Fixes #136080.
* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
ENOENT.
(filename_get_info): Likewise.
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c
......
2004-03-08 Federico Mena Quintero <federico@ximian.com>
Fixes #136080.
* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
ENOENT.
(filename_get_info): Likewise.
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c
......
2004-03-08 Federico Mena Quintero <federico@ximian.com>
Fixes #136080.
* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
ENOENT.
(filename_get_info): Likewise.
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c
......
2004-03-08 Federico Mena Quintero <federico@ximian.com>
Fixes #136080.
* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
ENOENT.
(filename_get_info): Likewise.
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c
......
2004-03-08 Federico Mena Quintero <federico@ximian.com>
Fixes #136080.
* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
ENOENT.
(filename_get_info): Likewise.
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c
......
......@@ -464,20 +464,22 @@ get_icon_type (const char *filename,
/* If stat fails, try to fall back to lstat to catch broken links
*/
if (stat (filename, &statbuf) != 0 &&
lstat (filename, &statbuf) != 0)
if (stat (filename, &statbuf) != 0)
{
int save_errno = errno;
gchar *filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
g_set_error (error,
GTK_FILE_SYSTEM_ERROR,
GTK_FILE_SYSTEM_ERROR_NONEXISTENT,
_("error getting information for '%s': %s"),
filename_utf8 ? filename_utf8 : "???",
g_strerror (save_errno));
g_free (filename_utf8);
if (errno != ENOENT || lstat (filename, &statbuf) != 0)
{
int save_errno = errno;
gchar *filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
g_set_error (error,
GTK_FILE_SYSTEM_ERROR,
GTK_FILE_SYSTEM_ERROR_NONEXISTENT,
_("error getting information for '%s': %s"),
filename_utf8 ? filename_utf8 : "???",
g_strerror (save_errno));
g_free (filename_utf8);
return ICON_NONE;
return ICON_NONE;
}
}
if (S_ISBLK (statbuf.st_mode))
......@@ -1387,21 +1389,22 @@ filename_get_info (const gchar *filename,
/* If stat fails, try to fall back to lstat to catch broken links
*/
if (do_stat &&
stat (filename, &statbuf) != 0 &&
lstat (filename, &statbuf) != 0)
if (do_stat && stat (filename, &statbuf) != 0)
{
int save_errno = errno;
gchar *filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
g_set_error (error,
GTK_FILE_SYSTEM_ERROR,
GTK_FILE_SYSTEM_ERROR_NONEXISTENT,
_("error getting information for '%s': %s"),
filename_utf8 ? filename_utf8 : "???",
g_strerror (save_errno));
g_free (filename_utf8);
if (errno != ENOENT || lstat (filename, &statbuf) != 0)
{
int save_errno = errno;
gchar *filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
g_set_error (error,
GTK_FILE_SYSTEM_ERROR,
GTK_FILE_SYSTEM_ERROR_NONEXISTENT,
_("error getting information for '%s': %s"),
filename_utf8 ? filename_utf8 : "???",
g_strerror (save_errno));
g_free (filename_utf8);
return NULL;
return NULL;
}
}
info = gtk_file_info_new ();
......
Markdown is supported
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