diff options
author | Havoc Pennington <hp@redhat.com> | 2003-05-12 22:29:19 +0000 |
---|---|---|
committer | Havoc Pennington <hp@pobox.com> | 2003-05-12 22:29:19 +0000 |
commit | 9d901a7f4feb34d48f40a8705d522fac66ef61e9 (patch) | |
tree | 3e27a3ee1294613fc6e9275eab3654d535803653 /src/desktop_file.c | |
parent | 349c98626c6357e6cf25326baf357a856f1b240d (diff) |
fix a bunch of compiler warnings (desktop_file_fixup): add code to fix
2003-05-12 Havoc Pennington <hp@redhat.com>
* src/validate.c: fix a bunch of compiler warnings
(desktop_file_fixup): add code to fix semicolon termination of
string lists if necessary.
* src/desktop_file.c (gnome_desktop_file_merge_string_into_list):
handle case where existing list is missing ';' at the end;
patch from Adrian Reber
Diffstat (limited to 'src/desktop_file.c')
-rw-r--r-- | src/desktop_file.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/desktop_file.c b/src/desktop_file.c index 2577e42..60be0b6 100644 --- a/src/desktop_file.c +++ b/src/desktop_file.c @@ -1390,7 +1390,19 @@ gnome_desktop_file_merge_string_into_list (GnomeDesktopFile *df, { /* Append to current list */ char *str; - str = g_strconcat (raw ? raw : "", value, ";", NULL); + if (raw) + { + int len; + len = strlen (raw); + /* handle broken file with no ';' after the list */ + if (len > 0 && raw[len-1] != ';') + str = g_strconcat (raw, ";", value, ";", NULL); + else + str = g_strconcat (raw, value, ";", NULL); + } + else + str = g_strconcat (value, ";", NULL); + gnome_desktop_file_set_raw (df, section, keyname, locale, str); g_free (str); } |