aboutsummaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-05-30 05:30:08 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-05-30 05:30:08 +0000
commitaff9b07fd352e323f1065088c8ce4643e8cbbf7a (patch)
treeae05530d4b81a98ca1eda6eaddff6a989e397ccf /epan/prefs.c
parentaf28c2b9eb252d15e8129e7d139a6d63f56b5669 (diff)
From Cal Turney:
Preferences with trailing commas are ignored. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8707 svn path=/trunk/; revision=49629
Diffstat (limited to 'epan/prefs.c')
-rw-r--r--epan/prefs.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index b2044c0cf1..5725f7439f 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -3009,6 +3009,13 @@ read_prefs_file(const char *pf_path, FILE *pf,
if (isalnum(got_c)) {
if (cur_var->len > 0) {
if (got_val) {
+ if (cur_val->str[strlen(cur_val->str)-1] == ',') {
+ /*
+ * If the pref has a trailing comma, eliminate it.
+ */
+ cur_val->str[strlen(cur_val->str)-1] = '\0';
+ g_warning ("%s line %d: trailing comma in \"%s\" %s", pf_path, pline, cur_var->str, hint);
+ }
/* Call the routine to set the preference; it will parse
the value as appropriate. */
switch (pref_set_pair_fct(cur_var->str, cur_val->str, private_data, FALSE)) {
@@ -3017,7 +3024,8 @@ read_prefs_file(const char *pf_path, FILE *pf,
break;
case PREFS_SET_SYNTAX_ERR:
- g_warning ("%s line %d: Syntax error in preference %s %s", pf_path, pline, cur_var->str, hint);
+ g_warning ("%s line %d: Syntax error in preference \"%s\" %s",
+ pf_path, pline, cur_var->str, hint);
break;
case PREFS_SET_NO_SUCH_PREF: