Browse Source

Fixed bug in checking of last char of environment variable

ceriel 33 years ago
parent
commit
13bb1c1117
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lang/cem/libcc.ansi/stdlib/getenv.c

+ 2 - 2
lang/cem/libcc.ansi/stdlib/getenv.c

@@ -18,8 +18,8 @@ getenv(const char *name)
 		return (char *)NULL;
 	while ((p = *v++) != NULL) {
 		q = name;
-		while (*q && (*q++ == *p++))
-			/* EMPTY */ ;
+		while (*q && (*q == *p++))
+			q++;
 		if (*q || (*p != '='))
 			continue;
 		return (char *)p + 1;