lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV Volatile getenv Buffer


From: T.E.Dickey
Subject: Re: LYNX-DEV Volatile getenv Buffer
Date: Thu, 22 Jan 1998 05:47:18 -0500 (EST)

> 
> Hello, Lyncei,
> 
> The string value returned by getenv is subject to overwriting by
> subsequent calls to getenv.  I just encountered this on OS/390.
> Here's a patch that fixes it for Home_Dir.  I suspect but haven't
> verified a similar problem with $DISPLAY.
thanks - will review & integrate.
 
> -- gil
> ================================================================
> diff -rc ./orig/lynxsrc/src/LYUtils.c ./lynxsrc/src/LYUtils.c
> *** ./orig/lynxsrc/src/LYUtils.c      Sun Jan 18 11:26:01 1998
> --- ./lynxsrc/src/LYUtils.c   Wed Jan 21 22:19:17 1998
> ***************
> *** 4640,4646 ****
>       static CONST char *homedir = NULL;
>   
>       if (!homedir) {
> !     if ((homedir = getenv("HOME")) == NULL) {
>   #ifdef VMS
>           if ((homedir = getenv("SYS$LOGIN")) == NULL) {
>               if ((homedir = getenv("SYS$SCRATCH")) == NULL)
> --- 4640,4651 ----
>       static CONST char *homedir = NULL;
>   
>       if (!homedir) {
> !     if ((homedir = getenv("HOME"))) {
> !             char *work = NULL;
> ! 
> !             StrAllocCopy(work, homedir);
> !             homedir = work;
> !         } else {
>   #ifdef VMS
>           if ((homedir = getenv("SYS$LOGIN")) == NULL) {
>               if ((homedir = getenv("SYS$SCRATCH")) == NULL)
> 


-- 
Thomas E. Dickey
address@hidden
http://www.clark.net/pub/dickey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]