mirror of
https://github.com/curl/curl.git
synced 2026-07-27 02:27:16 +03:00
made getenv() more threadsafe for win32
This commit is contained in:
parent
45885f30c2
commit
6d522c9c1d
5 changed files with 37 additions and 15 deletions
|
|
@ -387,6 +387,7 @@ void ProgressInit(struct UrlData *data, int max/*, int options, int moremax*/)
|
|||
/* 20000318 mgs */
|
||||
int scr_size [2];
|
||||
#endif
|
||||
char *colp;
|
||||
|
||||
if(data->conf&(CONF_NOPROGRESS|CONF_MUTE))
|
||||
return;
|
||||
|
|
@ -399,8 +400,11 @@ void ProgressInit(struct UrlData *data, int max/*, int options, int moremax*/)
|
|||
/* 20000318 mgs
|
||||
* OS/2 users most likely won't have this env var set, and besides that
|
||||
* we're using our own way to determine screen width */
|
||||
if (curl_GetEnv("COLUMNS") != NULL)
|
||||
width = atoi(curl_GetEnv("COLUMNS"));
|
||||
colp = curl_GetEnv("COLUMNS");
|
||||
if (colp != NULL) {
|
||||
width = atoi(colp);
|
||||
free(colp);
|
||||
}
|
||||
else
|
||||
width = 79;
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue