Joseph Galbraith wrote:
> C. Michael Pilato wrote:
> 
>> Philip Martin <philip@codematters.co.uk> writes:
>>
>>
>>> Ben Collins-Sussman <sussman@collab.net> writes:
>>>
>>>
>>>> On Jun 29, 2005, at 10:51 AM, Jonathan Malek wrote:
>>>>
>>>>> #define SVN_WC_ADM_DIR_NAME ( ( getenv( "SVN_ADM_DIR") ) ? ( getenv(
>>>>> "SVN_ADM_DIR") ) : (".svn") )
>>>
>>>
>>>> IANTSP -- "I am not the subversion project".  Do any other developers
>>>> have opinions about this?
>>>
>>>
>>> Calling getenv() that often is horrible.
>>
>>
>>
>> Well ... that answers one question in my previous email.  :-)
> 
> 
> Well, maybe this is better, or perhaps more horrible (excuse
> the C++ism and pseudo-hungarianisms:
> 
> char* getadmdir()
> {
>   static bool bHaveDir = false;
>   static char* szAdmDir = 0;
>   if ( ! bHaveDir )
>   {
>     bHaveDir = true;
>     szAdmDir = ::getevn("SVN_ADM_DIR");
>     if ( szAdmDir == 0 )
>        szAdmDir = ".svn";
>   }
> 
>   return szAdmDir;
> }
> 
> #define SVN_WC_ADM_DIR_NAME getadmdir()
Static variables like that are not especially thread safe.  And you're 
still depending on an environment variable, which seems like a rather 
fragile way to do configuration options like this.
-garrett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 29 18:49:10 2005