Mon Jun 15 13:18:21 1998 Jim Ingham <jingham@cygnus.com>
authorJim Ingham <jingham@apple.com>
Tue, 16 Jun 1998 19:36:47 +0000 (19:36 +0000)
committerJim Ingham <jingham@apple.com>
Tue, 16 Jun 1998 19:36:47 +0000 (19:36 +0000)
       * gdbtk.c (gdbtk_init): Add elements to the auto_path AS LIST
       ELEMENTS.  This allows gdbtk to work when installed in a directory
       which has a space in the path.  D. Moseley pointed out the bug.

gdb/ChangeLog-gdbtk
gdb/gdbtk.c

index c4da2fbe5ce28305892e358e08ac8e0afa643758..ce9903fb6e541274d1f7bde6b7f9a0aee6623b7d 100644 (file)
@@ -1,3 +1,10 @@
+Mon Jun 15 13:18:21 1998  Jim Ingham <jingham@cygnus.com>
+
+       * gdbtk.c (gdbtk_init): Add elements to the auto_path AS LIST
+       ELEMENTS.  This allows gdbtk to work when installed in a directory 
+       which has a space in the path.  D. Moseley pointed out the bug.
+
+
 Tue Jun  9 14:10:46 1998  Keith Seitz  <keiths@cygnus.com>
 
        * gdbtk.c (gdb_get_vars_command): Return static variables and
index 15e5ed1989b19c58152f3d7367de2826a4fbbba1..b1da0eedbac9121ab75f56b2841ebc1511b69de4 100644 (file)
@@ -2127,6 +2127,7 @@ gdbtk_init ( argv0 )
   struct cleanup *old_chain;
   char *lib, *gdbtk_lib, *gdbtk_lib_tmp, *gdbtk_file;
   int i, found_main;
+  Tcl_Obj *auto_path_elem, *auto_path_name;
 #ifndef WINNT
   struct sigaction action;
   static sigset_t nullsigmask = {0};
@@ -2379,9 +2380,14 @@ gdbtk_init ( argv0 )
   found_main = 0;
   /* see if GDBTK_LIBRARY is a path list */
   lib = strtok (gdbtk_lib_tmp, GDBTK_PATH_SEP);
+  auto_path_elem = Tcl_NewObj ();
+  auto_path_name = Tcl_NewStringObj ("auto_path", -1);
+
   do
     {
-      if (Tcl_VarEval (interp, "lappend auto_path ", lib, NULL) != TCL_OK)
+      Tcl_SetStringObj (auto_path_elem, lib, -1);
+      if (Tcl_ObjSetVar2 (interp, auto_path_name, NULL, auto_path_elem,
+                         TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT ) == NULL)
        {
          fputs_unfiltered (Tcl_GetVar (interp, "errorInfo", 0), gdb_stderr);
          error ("");
@@ -2399,7 +2405,9 @@ gdbtk_init ( argv0 )
   while ((lib = strtok (NULL, ":")) != NULL);
 
   free (gdbtk_lib_tmp);
-
+  Tcl_DecrRefCount(auto_path_elem);
+  Tcl_DecrRefCount(auto_path_name);
+      
   if (!found_main)
     {
       /* Try finding it with the auto path.  */