Control: tags -1 upstream patch
Control: forwarded -1 flightgear-de...@lists.sourceforge.net

The above patch doesn't compile, but this one does, and appears to work. I have reported this upstream.

--- a/src/run_posix.cxx
+++ b/src/run_posix.cxx
@@ -124,9 +124,16 @@ Wizard::run_fgfs( const std::string &args )
            buf[0] = 0;
            prefs.get( Fl_Preferences::Name("env-var-%d", i),
                       buf, "", buflen-1 );
-           char* s = strdup( buf );
-           putenv( s );
-            free( s );
+            char* equals = strchr(buf, '=');
+ if (equals == NULL) { /* environment variable name without a value;
+              unsetenv(buf);
+            }
+            else { /* value exists */
+ *equals = '\0'; /* replace '=' with a new terminator; the value f
+              setenv(/* name: */ buf,
+                     /* value: */ equals + 1,
+                     /* overwrite: */ 1);
+            }
        }
        vector<string> argv;
        argv.push_back( arg0 );


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to