Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (55 sloc) 1.73 kb
ba4e69b @bagder updated source code boilerplate/header
authored
1 /***************************************************************************
39af394 @bagder removed tabs and trailing whitespace from source
authored
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
ae1912c @bagder Initial revision
authored
6 * \___|\___/|_| \_\_____|
7 *
46480bb @masali-hp SSPI related code: Unicode support for WinCE
masali-hp authored
8 * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
ae1912c @bagder Initial revision
authored
9 *
ba4e69b @bagder updated source code boilerplate/header
authored
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at http://curl.haxx.se/docs/copyright.html.
39af394 @bagder removed tabs and trailing whitespace from source
authored
13 *
24dee48 @bagder dual-license fix
authored
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
ba4e69b @bagder updated source code boilerplate/header
authored
16 * furnished to do so, under the terms of the COPYING file.
ae1912c @bagder Initial revision
authored
17 *
24dee48 @bagder dual-license fix
authored
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
ae1912c @bagder Initial revision
authored
20 *
ba4e69b @bagder updated source code boilerplate/header
authored
21 ***************************************************************************/
ae1912c @bagder Initial revision
authored
22
a18d41a @bagder include setup.h
authored
23 #include "setup.h"
24
3184a91 @yangtse VMS specific preprocessor symbol checking adjustments
yangtse authored
25 #ifdef __VMS
93bcfd4 @bagder Nico Baggus' VMS adjustments
authored
26 #include <unixlib.h>
27 #endif
28
4d17d68 @bagder Dan Fandrich's cleanup patch to make pedantic compiler options cause …
authored
29 #include <curl/curl.h>
33a3753 @yangtse libcurl's memory.h renamed to curl_memory.h
yangtse authored
30 #include "curl_memory.h"
4d17d68 @bagder Dan Fandrich's cleanup patch to make pedantic compiler options cause …
authored
31
0f8facb @bagder added memory debugging include file
authored
32 #include "memdebug.h"
33
4031104 @bagder Internal symbols that aren't static are now prefixed with 'Curl_'
authored
34 static
9a7fc9c @bagder added const to the function protos
authored
35 char *GetEnv(const char *variable)
ae1912c @bagder Initial revision
authored
36 {
24d47a6 @bagder Paul Nolan fix to make libcurl build nicely on Windows CE
authored
37 #ifdef _WIN32_WCE
38 return NULL;
39 #else
ae1912c @bagder Initial revision
authored
40 #ifdef WIN32
6d522c9 @bagder made getenv() more threadsafe for win32
authored
41 char env[MAX_PATH]; /* MAX_PATH is from windef.h */
ae1912c @bagder Initial revision
authored
42 char *temp = getenv(variable);
43 env[0] = '\0';
cbd1a77 @bagder if () => if()
authored
44 if(temp != NULL)
46480bb @masali-hp SSPI related code: Unicode support for WinCE
masali-hp authored
45 ExpandEnvironmentStringsA(temp, env, sizeof(env));
9c5cd6c @yangtse Fix compiler warning: the address of 'env' will always evaluate as 't…
yangtse authored
46 return (env[0] != '\0')?strdup(env):NULL;
ae1912c @bagder Initial revision
authored
47 #else
48 char *env = getenv(variable);
3184a91 @yangtse VMS specific preprocessor symbol checking adjustments
yangtse authored
49 #ifdef __VMS
cbd1a77 @bagder if () => if()
authored
50 if(env && strcmp("HOME",variable) == 0)
aac739c @yangtse ANSI C compatibility adjustment
yangtse authored
51 env = decc_translate_vms(env);
ae1912c @bagder Initial revision
authored
52 #endif
0819c3a @dfandrich Don't strdup an empty string
dfandrich authored
53 return (env && env[0])?strdup(env):NULL;
93bcfd4 @bagder Nico Baggus' VMS adjustments
authored
54 #endif
24d47a6 @bagder Paul Nolan fix to make libcurl build nicely on Windows CE
authored
55 #endif
ae1912c @bagder Initial revision
authored
56 }
57
9a7fc9c @bagder added const to the function protos
authored
58 char *curl_getenv(const char *v)
ae1912c @bagder Initial revision
authored
59 {
60 return GetEnv(v);
61 }
Something went wrong with that request. Please try again.