[Mit-cadr-cvs] r377 - trunk/emulator/usim

ggilley at common-lisp.net ggilley at common-lisp.net
Fri Nov 30 07:02:40 UTC 2012


Author: ggilley
Date: Thu Nov 29 23:02:40 2012
New Revision: 377

Log:
i'm going in circles :-(

Modified:
   trunk/emulator/usim/Files.c

Modified: trunk/emulator/usim/Files.c
==============================================================================
--- trunk/emulator/usim/Files.c	Thu Nov 29 22:40:49 2012	(r376)
+++ trunk/emulator/usim/Files.c	Thu Nov 29 23:02:40 2012	(r377)
@@ -2257,23 +2257,27 @@
 	char *wild;
 	size_t len = strlen(x->x_realname);
 
+	//printf("diropen: %s -> ", x->x_realname);
+
 	// lisp keeps appending .wild
 	for (wild=x->x_realname; *wild; wild++, len--)
             if (*wild == 'w' && len > 3)
             {
-                if (*(wild + 1) == 'i' && *(wild+2) == 'l' && *(wild + 3) == 'd')
+                if (*(wild + 1) == 'i' && *(wild + 2) == 'l' && *(wild + 3) == 'd')
                 {
                     *wild = '\0';
-                    if (wild != x->x_realname && *(wild - 1) == '.')
+                    while (wild != x->x_realname && *(wild - 1) == '.')
+		    {
                         *(wild - 1) = '\0';
-
+			wild--;
+		    }
                 }
              }
 
-    if (x->x_realname[len-1] == '/')
-        x->x_realname[len-1] = '\0';
+    if (x->x_realname[strlen(x->x_realname)-1] == '/')
+        x->x_realname[strlen(x->x_realname)-1] = '\0';
 
-	log(LOG_INFO, "diropen: %s\n", x->x_realname);
+//	printf("%s\n", x->x_realname);
 
 	x->x_glob = glob(x->x_realname);
 	if ((errcode = globerr) != 0)




More information about the mit-cadr-cvs mailing list