diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2008-07-16 18:09:24 +0000 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2008-07-16 18:09:24 +0000 |
commit | 47c276da54ae34ad7d601177140bf5b8f7a78b10 (patch) | |
tree | 80f85dc39d6a5db2432df722c8ee2577efb61631 | |
parent | 52deed8edc47146b067dde42cee0a53b7bd011ed (diff) |
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
-rw-r--r-- | epan/prefs.c | 17 |
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) { |