[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MiNT 1.12: a few bug fixes



Here is a patch that fixes a few bugs in MiNT 1.12:

- biosfs.c: always use case insensitive comparison on file names
- dosdir.c (d_delete): don't change anything until everything has been
  verified
- mem.h: parenthesize argument in the ROUND macro to make it robust


diff -ur orig/biosfs.c ./biosfs.c
--- orig/biosfs.c	Tue Aug 30 17:55:34 1994
+++ ./biosfs.c	Mon Nov 28 22:34:34 1994
@@ -943,7 +943,7 @@
 
 	/* ts: let's see if such an entry already exists */
 	for (b=broot; b; b=b->next)
-		if (!strcmp(b->name, name))
+		if (!stricmp(b->name, name))
 			break;
 
 	switch((unsigned)cmd) {
diff -ur orig/dosdir.c ./dosdir.c
--- orig/dosdir.c	Mon Nov 14 21:29:28 1994
+++ ./dosdir.c	Sat Nov 19 12:01:08 1994
@@ -191,15 +191,22 @@
 				release_cookie(&targdir);
 				release_cookie(&parentdir);
 				return EACCDN;
-			} else if (samefile(&targdir, &p->curdir[i])) {
-				if (i == p->curdrv && p != curproc) {
+			} else if (i == p->curdrv && p != curproc &&
+				   samefile(&targdir, &p->curdir[i])) {
 					DEBUG(("Ddelete: directory %s is in use",
 						path));
 					goto noaccess;
-				} else {
-					release_cookie(&p->curdir[i]);
-					dup_cookie(&p->curdir[i], &p->root[i]);
-				} 
+			}
+		}
+	    }
+	    /* Wait with this until everything has been verified */
+	    for (p = proclist; p; p = p->gl_next) {
+		if (p->wait_q == ZOMBIE_Q || p->wait_q == TSR_Q)
+			continue;
+		for (i = 0; i < NUM_DRIVES; i++) {
+			if (samefile(&targdir, &p->curdir[i])) {
+				release_cookie(&p->curdir[i]);
+				dup_cookie(&p->curdir[i], &p->root[i]);
 			}
 		}
 	    }
diff -ur orig/mem.h ./mem.h
--- orig/mem.h	Tue Aug 30 17:55:50 1994
+++ ./mem.h	Fri Nov 18 23:23:48 1994
@@ -147,7 +147,7 @@
 extern int screen_boundary;
 
 #define MASKBITS	(no_mem_prot ? screen_boundary : (QUANTUM-1))
-#define ROUND(size) ((size + MASKBITS) & ~MASKBITS)
+#define ROUND(size) (((size) + MASKBITS) & ~MASKBITS)
 
 /* interesting memory constants */