Fixes problem for switching gtk theme through the controlcenter

without any existing ~/.gtkrc. Problem reported by Maurice Nonnekes
<maurice@amaze.nl> who also provided an initial patch. From maintainer
This commit is contained in:
wilfried 2001-11-09 22:35:52 +00:00
parent 8754c740de
commit 9d8db555c9

View File

@ -0,0 +1,36 @@
$OpenBSD: patch-capplets_theme-switcher_lister_c,v 1.1 2001/11/09 22:35:52 wilfried Exp $
--- capplets/theme-switcher/lister.c.orig Sat Aug 5 22:25:36 2000
+++ capplets/theme-switcher/lister.c Thu Oct 25 13:32:58 2001
@@ -159,16 +159,22 @@ edit_file_to_use (gchar *file, gchar *th
while (!feof (fin))
{
- getline (&lineptr, &linecount, fin);
- if (ferror(fin))
- {
- errstring = g_strdup_printf ("Error reading from RC file %s: %s",
- file, g_strerror (errno));
- goto error;
- }
-
- if (!strcmp(MARK_STRING, lineptr))
- marker_count += 1;
+ if( getline (&lineptr, &linecount, fin) == -1 )
+ {
+ /* Doesn't have to be an error, could be a zerobyte file
+ */
+ if (ferror(fin))
+ {
+ errstring = g_strdup_printf ("Error reading from RC file %s: %s",
+ file, g_strerror (errno));
+ goto error;
+ }
+ }
+ else
+ {
+ if (!strcmp(MARK_STRING, lineptr))
+ marker_count += 1;
+ }
}
rewind(fin);
if (!marker_count)