From 76fb8170a9d23e32762d0213ad68e8c8028df748 Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Sat, 10 Apr 1999 00:30:23 +0000 Subject: [PATCH] Make the windows specific code use nsprPath. --- base/src/windows/nsFileSpecWin.cpp | 16 ++++++++-------- xpcom/io/nsFileSpecWin.cpp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/base/src/windows/nsFileSpecWin.cpp b/base/src/windows/nsFileSpecWin.cpp index 1665849bc749..074252b974d9 100644 --- a/base/src/windows/nsFileSpecWin.cpp +++ b/base/src/windows/nsFileSpecWin.cpp @@ -177,7 +177,7 @@ PRBool nsFileSpec::Exists() const //---------------------------------------------------------------------------------------- { struct stat st; - return 0 == stat(mPath, &st); + return 0 == stat(nsprPath(*this), &st); } // nsFileSpec::Exists //---------------------------------------------------------------------------------------- @@ -185,7 +185,7 @@ void nsFileSpec::GetModDate(TimeStamp& outStamp) const //---------------------------------------------------------------------------------------- { struct stat st; - if (stat(mPath, &st) == 0) + if (stat(nsprPath(*this), &st) == 0) outStamp = st.st_mtime; else outStamp = 0; @@ -196,7 +196,7 @@ PRUint32 nsFileSpec::GetFileSize() const //---------------------------------------------------------------------------------------- { struct stat st; - if (stat(mPath, &st) == 0) + if (stat(nsprPath(*this), &st) == 0) return (PRUint32)st.st_size; return 0; } // nsFileSpec::GetFileSize @@ -206,7 +206,7 @@ PRBool nsFileSpec::IsFile() const //---------------------------------------------------------------------------------------- { struct stat st; - return 0 == stat(mPath, &st) && (_S_IFREG & st.st_mode); + return 0 == stat(nsprPath(*this), &st) && (_S_IFREG & st.st_mode); } // nsFileSpec::IsFile //---------------------------------------------------------------------------------------- @@ -214,7 +214,7 @@ PRBool nsFileSpec::IsDirectory() const //---------------------------------------------------------------------------------------- { struct stat st; - return 0 == stat(mPath, &st) && (_S_IFDIR & st.st_mode); + return 0 == stat(nsprPath(*this), &st) && (_S_IFDIR & st.st_mode); } // nsFileSpec::IsDirectory //---------------------------------------------------------------------------------------- @@ -250,7 +250,7 @@ void nsFileSpec::CreateDirectory(int /*mode*/) //---------------------------------------------------------------------------------------- { // Note that mPath is canonical! - mkdir(mPath); + mkdir(nsprPath(*this)); } // nsFileSpec::CreateDirectory //---------------------------------------------------------------------------------------- @@ -267,11 +267,11 @@ void nsFileSpec::Delete(PRBool inRecursive) const child.Delete(inRecursive); } } - rmdir(mPath); + rmdir(nsprPath(*this)); } else { - remove(mPath); + remove(nsprPath(*this)); } } // nsFileSpec::Delete diff --git a/xpcom/io/nsFileSpecWin.cpp b/xpcom/io/nsFileSpecWin.cpp index 1665849bc749..074252b974d9 100644 --- a/xpcom/io/nsFileSpecWin.cpp +++ b/xpcom/io/nsFileSpecWin.cpp @@ -177,7 +177,7 @@ PRBool nsFileSpec::Exists() const //---------------------------------------------------------------------------------------- { struct stat st; - return 0 == stat(mPath, &st); + return 0 == stat(nsprPath(*this), &st); } // nsFileSpec::Exists //---------------------------------------------------------------------------------------- @@ -185,7 +185,7 @@ void nsFileSpec::GetModDate(TimeStamp& outStamp) const //---------------------------------------------------------------------------------------- { struct stat st; - if (stat(mPath, &st) == 0) + if (stat(nsprPath(*this), &st) == 0) outStamp = st.st_mtime; else outStamp = 0; @@ -196,7 +196,7 @@ PRUint32 nsFileSpec::GetFileSize() const //---------------------------------------------------------------------------------------- { struct stat st; - if (stat(mPath, &st) == 0) + if (stat(nsprPath(*this), &st) == 0) return (PRUint32)st.st_size; return 0; } // nsFileSpec::GetFileSize @@ -206,7 +206,7 @@ PRBool nsFileSpec::IsFile() const //---------------------------------------------------------------------------------------- { struct stat st; - return 0 == stat(mPath, &st) && (_S_IFREG & st.st_mode); + return 0 == stat(nsprPath(*this), &st) && (_S_IFREG & st.st_mode); } // nsFileSpec::IsFile //---------------------------------------------------------------------------------------- @@ -214,7 +214,7 @@ PRBool nsFileSpec::IsDirectory() const //---------------------------------------------------------------------------------------- { struct stat st; - return 0 == stat(mPath, &st) && (_S_IFDIR & st.st_mode); + return 0 == stat(nsprPath(*this), &st) && (_S_IFDIR & st.st_mode); } // nsFileSpec::IsDirectory //---------------------------------------------------------------------------------------- @@ -250,7 +250,7 @@ void nsFileSpec::CreateDirectory(int /*mode*/) //---------------------------------------------------------------------------------------- { // Note that mPath is canonical! - mkdir(mPath); + mkdir(nsprPath(*this)); } // nsFileSpec::CreateDirectory //---------------------------------------------------------------------------------------- @@ -267,11 +267,11 @@ void nsFileSpec::Delete(PRBool inRecursive) const child.Delete(inRecursive); } } - rmdir(mPath); + rmdir(nsprPath(*this)); } else { - remove(mPath); + remove(nsprPath(*this)); } } // nsFileSpec::Delete