From b81f3bd5b7ab379bc10a307a72c877cb15cceed7 Mon Sep 17 00:00:00 2001 From: "wtc%google.com" Date: Sat, 1 Sep 2007 05:36:33 +0000 Subject: [PATCH] Bug 392722: fixed the bug that nsinstall chokes on double slashes in path. The patch is contributed by Fabien Tassin . r=wtc. git-svn-id: svn://10.0.0.236/trunk@233540 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/nsprpub/config/nsinstall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mozilla/nsprpub/config/nsinstall.c b/mozilla/nsprpub/config/nsinstall.c index e9f1aebda0c..80d907edf23 100644 --- a/mozilla/nsprpub/config/nsinstall.c +++ b/mozilla/nsprpub/config/nsinstall.c @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -135,8 +135,8 @@ mkdirs(char *path, mode_t mode) while (*path == '/' && path[1] == '/') path++; - while ((cp = strrchr(path, '/')) && cp[1] == '\0') - *cp = '\0'; + for (cp = strrchr(path, '/'); cp && cp != path && cp[-1] == '/'; cp--) + ; if (cp && cp != path) { *cp = '\0'; if ((stat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&