summaryrefslogtreecommitdiff
path: root/epan/prefs.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2008-07-16 18:09:24 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2008-07-16 18:09:24 +0000
commit47c276da54ae34ad7d601177140bf5b8f7a78b10 (patch)
tree80f85dc39d6a5db2432df722c8ee2577efb61631 /epan/prefs.c
parent52deed8edc47146b067dde42cee0a53b7bd011ed (diff)
downloadwireshark-47c276da54ae34ad7d601177140bf5b8f7a78b10.tar.gz
From Balint Reczey:
When saving preferences, wireshark saves the description of each preference in a one line comment. Unfortunately if the description consists of several lines, wireshark comments out only the fist one. The attached patch solves the problem by commenting out every lines in the description. svn path=/trunk/; revision=25756
Diffstat (limited to 'epan/prefs.c')
-rw-r--r--epan/prefs.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 47bea36a85..a16ec142ac 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -2472,6 +2472,8 @@ write_pref(gpointer data, gpointer user_data)
write_pref_arg_t *arg = user_data;
const enum_val_t *enum_valp;
const char *val_string;
+ gchar **desc_lines;
+ int i;
if (pref->type == PREF_OBSOLETE) {
/*
@@ -2483,7 +2485,20 @@ write_pref(gpointer data, gpointer user_data)
return;
}
- fprintf(arg->pf, "\n# %s\n", pref->description);
+ /*
+ * Make multiple line descriptions appear as
+ * multiple commented lines in prefs file.
+ */
+ if (g_ascii_strncasecmp(pref->description,"", 2) != 0) {
+ desc_lines = g_strsplit(pref->description,"\n",0);
+ for (i = 0; desc_lines[i] != NULL; ++i) {
+ fprintf(arg->pf, "\n# %s", desc_lines[i]);
+ }
+ fprintf(arg->pf, "\n");
+ g_strfreev(desc_lines);
+ } else {
+ fprintf(arg->pf, "\n# No description\n");
+ }
switch (pref->type) {