From b5c295b84a6e3580efa2c7efbda811d6220b4f6d Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Fri, 25 Jun 2004 16:11:50 +0000 Subject: INTEGRATION: CWS tune04 (1.4.74); FILE MERGED 2004/06/10 12:08:29 cmc 1.4.74.2: #i29636# turn global objects into local static data protected with swishy double-locked templated template 2004/06/04 12:20:42 cmc 1.4.74.1: #i29636# unused sLastCaseSensitiveDir variables --- tools/source/fsys/unx.cxx | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'tools/source/fsys') diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx index a6f139da060a..9b45aa22bf3f 100644 --- a/tools/source/fsys/unx.cxx +++ b/tools/source/fsys/unx.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unx.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: vg $ $Date: 2004-01-06 18:33:46 $ + * last change: $Author: hjs $ $Date: 2004-06-25 17:11:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,6 +95,10 @@ struct mnttab #include #include "comdep.hxx" +#ifndef INCLUDED_RTL_INSTANCE_HXX +#include +#endif + DECLARE_LIST( DirEntryList, DirEntry* ) DECLARE_LIST( FSysSortList, FSysSort* ) DECLARE_LIST( FileStatList, FileStat* ) @@ -114,7 +118,6 @@ DECLARE_LIST( FileStatList, FileStat* ) #define MOUNTFS mnt_type #endif -static ByteString sLastCaseSensitiveDir = ""; static BOOL bLastCaseSensitive = FALSE; struct mymnttab @@ -358,8 +361,7 @@ BOOL DirEntry::ToAbs() |* *************************************************************************/ -static mymnttab mymnt; -static String aEmptyString; +namespace { struct mymnt : public rtl::Static< mymnttab, mymnt > {}; } String DirEntry::GetVolume() const { @@ -372,12 +374,14 @@ String DirEntry::GetVolume() const while (stat (ByteString(aPath.GetFull(), osl_getThreadTextEncoding()).GetBuffer(), &buf)) { if (aPath.Level() <= 1) - return aEmptyString; + return String(); aPath = aPath [1]; } - - return ((buf.st_dev == mymnt.mountdevice || - GetMountEntry(buf.st_dev, &mymnt)) ? String(mymnt.mountspecial, osl_getThreadTextEncoding()) : aEmptyString); + mymnttab &rMnt = mymnt::get(); + return ((buf.st_dev == rMnt.mountdevice || + GetMountEntry(buf.st_dev, &rMnt)) ? + String(rMnt.mountspecial, osl_getThreadTextEncoding()) : + String()); } DirEntry DirEntry::GetDevice() const @@ -391,11 +395,14 @@ DirEntry DirEntry::GetDevice() const while (stat (ByteString(aPath.GetFull(), osl_getThreadTextEncoding()).GetBuffer(), &buf)) { if (aPath.Level() <= 1) - return aEmptyString; + return String(); aPath = aPath [1]; } - return ((buf.st_dev == mymnt.mountdevice || - GetMountEntry(buf.st_dev, &mymnt)) ? String( mymnt.mountpoint, osl_getThreadTextEncoding()) : aEmptyString); + mymnttab &rMnt = mymnt::get(); + return ((buf.st_dev == rMnt.mountdevice || + GetMountEntry(buf.st_dev, &rMnt)) ? + String( rMnt.mountpoint, osl_getThreadTextEncoding()) : + String()); } /************************************************************************* -- cgit