]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rename variables
authorAlan T. DeKok <aland@freeradius.org>
Mon, 22 Sep 2025 22:29:22 +0000 (18:29 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 22 Sep 2025 22:30:51 +0000 (18:30 -0400)
to be more consistent with _dict_from_file()

src/lib/util/dict_tokenize.c

index dd8e9855d206e3ec363d334c05a2a47a44a78746..28c7b6d0292e44dc2be0c4f7d547d35397f9da91 100644 (file)
@@ -1164,8 +1164,9 @@ static int dict_read_process_include(dict_tokenize_ctx_t *dctx, char **argv, int
 {
        int rcode;
        int stack_depth = dctx->stack_depth;
-       char *filename = dctx->filename;
-       int line = dctx->line;
+       char *src_file = dctx->filename;
+       int src_line = dctx->line;
+       char *filename;
 
        /*
         *      Allow "$INCLUDE" or "$INCLUDE-", but
@@ -1177,42 +1178,43 @@ static int dict_read_process_include(dict_tokenize_ctx_t *dctx, char **argv, int
        }
 
        if (argc != 2) {
-               fr_strerror_printf("Unexpected text after $INCLUDE at %s[%d]", fr_cwd_strip(filename), line);
+               fr_strerror_printf("Unexpected text after $INCLUDE at %s[%d]", fr_cwd_strip(src_file), src_line);
                return -1;
        }
 
+       filename = argv[1];
+
        /*
-        *      Allow limited macro capability, so
-        *      people don't have to remember where
-        *      the root dictionaries are located.
+        *      Allow limited macro capability, so people don't have
+        *      to remember where the root dictionaries are located.
         */
-       if (strncmp(argv[1], "${dictdir}/", 11) != 0) {
-               rcode = _dict_from_file(dctx, dir, argv[1], filename, line);
-       } else {
-               rcode = _dict_from_file(dctx, fr_dict_global_ctx_dir(), argv[1] + 11, filename, line);
+       if (strncmp(filename, "${dictdir}/", 11) == 0) {
+               dir = fr_dict_global_ctx_dir();
+               filename += 11;
        }
 
+       rcode = _dict_from_file(dctx, dir, filename, src_file, src_line);
        if ((rcode == -2) && (argv[0][8] == '-')) {
                fr_strerror_clear(); /* delete all errors */
                return 0;
        }
 
        if (rcode < 0) {
-               fr_strerror_printf_push("from $INCLUDE at %s[%d]", fr_cwd_strip(filename), line);
+               fr_strerror_printf_push("from $INCLUDE at %s[%d]", fr_cwd_strip(src_file), src_line);
                return -1;
        }
 
        if (dctx->stack_depth < stack_depth) {
                fr_strerror_printf("unexpected END-??? in $INCLUDE at %s[%d]",
-                                  fr_cwd_strip(filename), line);
+                                  fr_cwd_strip(src_file), src_line);
                return -1;
        }
 
        /*
         *      Reset the filename and line number.
         */
-       dctx->filename = filename;
-       dctx->line = line;
+       dctx->filename = src_file;
+       dctx->line = src_line;
 
        return 0;
 }