]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Set lineno correctly
authorAlan T. DeKok <aland@freeradius.org>
Tue, 14 Jul 2015 00:53:56 +0000 (20:53 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 14 Jul 2015 01:12:32 +0000 (21:12 -0400)
src/main/files.c

index bf8cdf5dc2381803da8b763752234a0631f21aa4..58f72d6efa21ca5d4cbc43e725759332687af665 100644 (file)
@@ -89,7 +89,7 @@ int pairlist_read(TALLOC_CTX *ctx, char const *file, PAIR_LIST **list, int compl
        PAIR_LIST *pl = NULL, *t;
        PAIR_LIST **last = &pl;
        int lineno = 0;
-       int old_lineno = 0;
+       int entry_lineno = 0;
        FR_TOKEN parsecode;
 #ifdef HAVE_REGEX_H
        VALUE_PAIR *vp;
@@ -150,7 +150,7 @@ parse_again:
                         */                   
                        ptr = buffer;
                        getword(&ptr, entry, sizeof(entry), false);
-                       old_lineno = lineno;
+                       entry_lineno = lineno;
 
                        /*
                         *      Include another file if we see
@@ -277,7 +277,7 @@ parse_again:
                        talloc_free(check_tmp);
                        talloc_free(reply_tmp);
                        ERROR("%s[%d]: Invalid comma after the reply attributes.  Please delete it.",
-                             file, old_lineno);
+                             file, lineno);
                        fclose(fp);
                        return -1;
                }
@@ -288,7 +288,6 @@ parse_again:
                 */
                parsecode = userparse(ctx, buffer, &reply_tmp);
                if (parsecode == T_COMMA) {
-                       old_lineno = lineno;
                        continue;
                }
 
@@ -316,7 +315,7 @@ parse_again:
 
                t->check = check_tmp;
                t->reply = reply_tmp;
-               t->lineno = old_lineno;
+               t->lineno = entry_lineno;
                check_tmp = NULL;
                reply_tmp = NULL;