Revision: 77131
          http://sourceforge.net/p/brlcad/code/77131
Author:   starseeker
Date:     2020-09-13 16:20:37 +0000 (Sun, 13 Sep 2020)
Log Message:
-----------
At least for now, back out the cwd manipulation - looking into addressing this 
in the NSIS installer instead, which won't have the potentially broad impact 
this does.

Modified Paths:
--------------
    brlcad/branches/RELEASE/src/archer/archer.c
    brlcad/branches/RELEASE/src/mged/mged.c
    brlcad/branches/RELEASE/src/rtwizard/main.c

Modified: brlcad/branches/RELEASE/src/archer/archer.c
===================================================================
--- brlcad/branches/RELEASE/src/archer/archer.c 2020-09-13 15:58:34 UTC (rev 
77130)
+++ brlcad/branches/RELEASE/src/archer/archer.c 2020-09-13 16:20:37 UTC (rev 
77131)
@@ -26,10 +26,6 @@
 #include "bnetwork.h"
 #include "bio.h"
 
-#ifdef HAVE_WINDOWS_H
-#  include <direct.h> /* For chdir */
-#endif
-
 #include "tcl.h"
 #ifdef HAVE_TK
 #  include "tk.h"
@@ -99,19 +95,6 @@
     }
     bu_vls_free(&tlog);
 
-    /* If the working directory is BU_DIR_BIN, try shifting to the user's
-     * home directory instead */
-    char cwd[MAXPATHLEN] = {0};
-    char bindir[MAXPATHLEN] = {0};
-    bu_dir(cwd, MAXPATHLEN, BU_DIR_CURR, NULL);
-    bu_dir(bindir, MAXPATHLEN, BU_DIR_BIN, NULL);
-    if (BU_STR_EQUAL(cwd, bindir)) {
-       bu_dir(cwd, MAXPATHLEN, BU_DIR_HOME, NULL);
-       if (chdir(cwd)) {
-           bu_log("WARNING: working directory is the binary directory \"%s\" 
(read-only), and chdir to home directory \"%s\" failed.", bindir, cwd);
-       }
-    }
-
     archer_tcl = bu_brlcad_root("share/tclscripts/archer/archer_launch.tcl", 
1);
     Tcl_DStringInit(&temp);
     fullname = Tcl_TranslateFileName(interp, archer_tcl, &temp);

Modified: brlcad/branches/RELEASE/src/mged/mged.c
===================================================================
--- brlcad/branches/RELEASE/src/mged/mged.c     2020-09-13 15:58:34 UTC (rev 
77130)
+++ brlcad/branches/RELEASE/src/mged/mged.c     2020-09-13 16:20:37 UTC (rev 
77131)
@@ -49,10 +49,6 @@
 #  include <poll.h>
 #endif
 
-#ifdef HAVE_WINDOWS_H
-#  include <direct.h> /* For chdir */
-#endif
-
 #include "bio.h"
 #include "bsocket.h"
 
@@ -1051,21 +1047,6 @@
 
     bu_setprogname(argv[0]);
 
-
-    /* If the working directory is BU_DIR_BIN, try shifting to the user's
-     * home directory instead */
-    char cwd[MAXPATHLEN] = {0};
-    char bindir[MAXPATHLEN] = {0};
-    bu_dir(cwd, MAXPATHLEN, BU_DIR_CURR, NULL);
-    bu_dir(bindir, MAXPATHLEN, BU_DIR_BIN, NULL);
-    if (BU_STR_EQUAL(cwd, bindir)) {
-       bu_dir(cwd, MAXPATHLEN, BU_DIR_HOME, NULL);
-       if (chdir(cwd)) {
-           bu_log("WARNING: working directory is the binary directory \"%s\" 
(read-only), and chdir to home directory \"%s\" failed.", bindir, cwd);
-       }
-    }
-
-
     /* If multiple processors might be used, initialize for it.
      * Do not run any commands before here.
      * Do not use bu_log() or bu_malloc() before here.

Modified: brlcad/branches/RELEASE/src/rtwizard/main.c
===================================================================
--- brlcad/branches/RELEASE/src/rtwizard/main.c 2020-09-13 15:58:34 UTC (rev 
77130)
+++ brlcad/branches/RELEASE/src/rtwizard/main.c 2020-09-13 16:20:37 UTC (rev 
77131)
@@ -24,10 +24,6 @@
 #include "common.h"
 #include "string.h"
 
-#ifdef HAVE_WINDOWS_H
-#  include <direct.h> /* For chdir */
-#endif
-
 #include "tcl.h"
 
 #include "vmath.h"
@@ -1014,20 +1010,6 @@
        bu_exit(EXIT_SUCCESS, NULL);
     }
 
-    /* If the working directory is BU_DIR_BIN, try shifting to the user's
-     * home directory instead */
-    char cwd[MAXPATHLEN] = {0};
-    char bindir[MAXPATHLEN] = {0};
-    bu_dir(cwd, MAXPATHLEN, BU_DIR_CURR, NULL);
-    bu_dir(bindir, MAXPATHLEN, BU_DIR_BIN, NULL);
-    if (BU_STR_EQUAL(cwd, bindir)) {
-       bu_dir(cwd, MAXPATHLEN, BU_DIR_HOME, NULL);
-       if (chdir(cwd)) {
-           bu_log("WARNING: working directory is the binary directory \"%s\" 
(read-only), and chdir to home directory \"%s\" failed.  RtWizard requires a 
read/write working directory.", bindir, cwd);
-       }
-    }
-
-
     {
        int stop = 0;
        for (i = 0; i < uac; i++) {

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