From ba13e7893097805136285a33e169ecf3c8bc0c2a Mon Sep 17 00:00:00 2001 From: David Rajchenbach-Teller Date: Sun, 16 Dec 2012 19:36:27 -0500 Subject: [PATCH] Bug 820681 - OS.Constants.Path.{profileDir, localProfileDir} - Initialize strings to void. r=khuey --- dom/system/OSFileConstants.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dom/system/OSFileConstants.cpp b/dom/system/OSFileConstants.cpp index 139d567426fc..64de78c38e35 100644 --- a/dom/system/OSFileConstants.cpp +++ b/dom/system/OSFileConstants.cpp @@ -66,7 +66,7 @@ namespace { */ bool gInitialized = false; -typedef struct { +struct Paths { /** * The name of the directory holding all the libraries (libxpcom, libnss, etc.) */ @@ -74,7 +74,15 @@ typedef struct { nsString tmpDir; nsString profileDir; nsString localProfileDir; -} Paths; + + Paths() + { + libDir.SetIsVoid(true); + tmpDir.SetIsVoid(true); + profileDir.SetIsVoid(true); + localProfileDir.SetIsVoid(true); + } +}; /** * System directories. @@ -95,15 +103,10 @@ nsresult GetPathToSpecialDir(const char *aKey, nsString& aOutPath) nsCOMPtr file; nsresult rv = NS_GetSpecialDirectory(aKey, getter_AddRefs(file)); if (NS_FAILED(rv) || !file) { - aOutPath.SetIsVoid(true); return rv; } - rv = file->GetPath(aOutPath); - if (NS_FAILED(rv)) { - aOutPath.SetIsVoid(true); - } - return rv; + return file->GetPath(aOutPath); } /**