nikhilgupta10 / GridLAB-D

Other
1 stars 0 forks source link

#921 Modelname not set during processing of first GLM file, #2647

Open nikhilgupta10 opened 7 years ago

nikhilgupta10 commented 7 years ago

If the first GLM file in the argument list contains the expansion ${modelname} it does not get expanded during loader processing. This is because the global variable doesn't get set until after processing of the first GLM file is completed.

The strcpy() call needs to be moved to before the loadall() in cmdarg.c, i.e.:

--- cmdarg.c    (revision 5065)
+++ cmdarg.c    (revision 5066)
@@ -1345,13 +1345,14 @@
                else {
                    clock_t start = clock();

+                   /* preserve name of first model only */
+                   if (strcmp(global_modelname,\)==0)
+                       strcpy(global_modelname,*argv);
+
                    if (!loadall(*argv))
                        status = FAILED;
                    loader_time += clock() - start;

-                   /* preserve name of first model only */
-                   if (strcmp(global_modelname,\)==0)
-                       strcpy(global_modelname,*argv);
                }
            }
~~~~~,
nikhilgupta10 commented 7 years ago

nikhilgupta10 imported these comments from Sourceforge: The user dchassin does not exist anymore. Therefore assigning this to afisher1. "dchassin":Note that this was fixed in ticket 910.,

"dchassin":Fix applied to 3.2 in r5210.,

"dchassin":- status: new --> assigned