Fix a probably-harmless read of uninitialized memory in mkdir_p(), to
authorNeil Conway
Sat, 31 Jan 2004 22:10:00 +0000 (22:10 +0000)
committerNeil Conway
Sat, 31 Jan 2004 22:10:00 +0000 (22:10 +0000)
silence a valgrind warning.

src/bin/initdb/initdb.c

index 401427a0ba5c17dafa68376cc776e7f51ee64ce3..81607877da02a2f8798b700599d0bf76cf3d92be 100644 (file)
@@ -43,7 +43,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  * Portions taken from FreeBSD.
  *
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.20 2004/01/31 21:18:00 neilc Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.21 2004/01/31 22:10:00 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -553,7 +553,7 @@ mkdir_p(char *path, mode_t omode)
        else if (p[0] != '/')
            continue;
        *p = '\0';
-       if (p[1] == '\0')
+       if (!last && p[1] == '\0')
            last = 1;
        if (first)
        {