fix xfree() so it can be re-written as a macro
authorChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Wed, 4 Sep 1991 16:36:51 +0000 (08:36 -0800)
committerChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Wed, 4 Sep 1991 16:36:51 +0000 (08:36 -0800)
SCCS-vsn: bin/csh/func.c 5.25
SCCS-vsn: bin/csh/misc.c 5.15

usr/src/bin/csh/func.c
usr/src/bin/csh/misc.c

index d3fe63d..9011738 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)func.c     5.24 (Berkeley) %G%";
+static char sccsid[] = "@(#)func.c     5.25 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -982,7 +982,8 @@ dounsetenv(v, t)
                Unsetenv(name);
                break;
            }
                Unsetenv(name);
                break;
            }
-    xfree((ptr_t) name), name = NULL;
+    xfree((ptr_t) name);
+    name = NULL;
 }
 
 void
 }
 
 void
index 13232d0..e8398f9 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     5.14 (Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c     5.15 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -303,10 +303,10 @@ lshift(v, c)
     register Char **v;
     register int c;
 {
     register Char **v;
     register int c;
 {
-    register Char **u = v;
+    register Char **u;
 
 
-    while (*u && --c >= 0)
-       xfree((ptr_t) * u++);
+    for (u = v; *u && --c >= 0; u++)
+       xfree((ptr_t) *u);
     (void) blkcpy(v, u);
 }
 
     (void) blkcpy(v, u);
 }