Hi all,

The patch I posted to get directory handling to work properly when Insight is built for Win32 machines doesn't :-) I thought DIRNAME_SEPARATOR was '/', but it is actually ':'. The attached patch corrects this, and works somewhat better!

Regards,
Steve
--- source.c.orig       Wed Nov 27 20:39:00 2002
+++ source.c    Wed Nov 27 19:57:35 2002
@@ -746,19 +746,46 @@
 
 char *
 symtab_to_filename (struct symtab *s)
 {
   int fd;
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+  char *p;
+  char *dir;
+#endif
 
   if (!s)
     return NULL;
 
   /* If we've seen the file before, just return fullname. */
 
   if (s->fullname)
     return s->fullname;
 
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+  if (s->dirname)
+    {
+      for (p = s->dirname;  *p;  p++)
+        {
+          if (*p == '\\')
+            *p = '/';
+        }
+      if (s->dirname[0] != '\0'  &&  s->dirname[1] == ':')
+        {
+          dir = (char *) alloca (50 + 1 + strlen (s->dirname) + 1);
+          s->dirname[1] = '\0';
+          strcpy(dir, "/cygdrive/");
+          strcat(dir, s->dirname);
+          if (s->dirname[2] != '/')
+            strcat(dir, "/$cwd/");
+          strcat(dir, s->dirname + 2);
+          free(s->dirname);
+          s->dirname = dir;
+        }
+      }
+#endif
+ 
   /* Try opening the file to setup fullname */
 
   fd = open_source_file (s);
   if (fd < 0)
     return s->filename;                /* File not found.  Just use short name 
*/

Reply via email to