changeset 4605:5a7e265d3d42

have prefs parser syntax error print line number
author corvid
date So, 26 Jun 2016 00:10:20 +0000
parents c5bb203f3238
children eb21d16531ce
files src/prefsparser.cc
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/prefsparser.cc	So Jun 26 00:01:32 2016 +0000
+++ b/src/prefsparser.cc	So Jun 26 00:10:20 2016 +0000
@@ -142,7 +142,7 @@
 void PrefsParser::parse(FILE *fp)
 {
    char *line, *name, *value, *oldLocale;
-   int st;
+   int st, line_number = 1;
 
    /* Symbol array, sorted alphabetically */
    static SymNode_t symbols[] = {
@@ -246,11 +246,11 @@
          _MSG("prefsparser: name=%s, value=%s\n", name, value);
          parseOption(name, value, symbols, sizeof(symbols) / sizeof(symbols[0]));
       } else if (st < 0) {
-         MSG_ERR("prefsparser: Syntax error in dillorc:"
-                 " name=\"%s\" value=\"%s\"\n", name, value);
+         MSG_ERR("prefsparser: Syntax error in dillorc line %d:"
+                 " name=\"%s\" value=\"%s\"\n", line_number, name, value);
       }
-
       dFree(line);
+      line_number++;
    }
    fclose(fp);