Revision: 78173
          http://sourceforge.net/p/brlcad/code/78173
Author:   starseeker
Date:     2021-02-04 16:26:43 +0000 (Thu, 04 Feb 2021)
Log Message:
-----------
We don't know what calling code may or may not do with their argv array and 
contents - they own it.  Restore the original state of the argv[0] entry before 
returning.

Modified Paths:
--------------
    brlcad/trunk/src/libged/exec_mapping.cpp

Modified: brlcad/trunk/src/libged/exec_mapping.cpp
===================================================================
--- brlcad/trunk/src/libged/exec_mapping.cpp    2021-02-04 15:23:43 UTC (rev 
78172)
+++ brlcad/trunk/src/libged/exec_mapping.cpp    2021-02-04 16:26:43 UTC (rev 
78173)
@@ -48,6 +48,7 @@
        int GED_CMD_HELPER1(ged_,x)(struct ged *gedp, int argc, const char 
*argv[]) \
        { \
            const char *fname = #x ; \
+           const char *argv0 = argv[0] ; \
            int vret = ged_cmd_valid(argv[0], fname); \
            if (vret) { \
                argv[0] = fname; \
@@ -56,6 +57,7 @@
            if (vret) { \
                ret |= GED_UNKNOWN; \
            } \
+           argv[0] = argv0; \
            return ret; \
        } \
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to