]> granicus.if.org Git - curl/commitdiff
tool: fix Windows Unicode build
authorMarcel Raad <raad@teamviewer.com>
Tue, 4 Apr 2017 21:02:16 +0000 (23:02 +0200)
committerMarcel Raad <raad@teamviewer.com>
Tue, 4 Apr 2017 21:04:29 +0000 (23:04 +0200)
... by explicitly calling the ANSI versions of Windows API functions where
required.

src/tool_homedir.c
src/tool_parsecfg.c

index 26b6c535ca35b9d844c8751737a1c0c1b8a3cc18..483553d59bbaaefa34e0ba7ae4cdc96e9adde2c7 100644 (file)
@@ -39,14 +39,14 @@ static char *GetEnv(const char *variable, char do_expand)
   /* Don't use getenv(); it doesn't find variable added after program was
    * started. Don't accept truncated results (i.e. rc >= sizeof(buf1)).  */
 
-  rc = GetEnvironmentVariable(variable, buf1, sizeof(buf1));
+  rc = GetEnvironmentVariableA(variable, buf1, sizeof(buf1));
   if(rc > 0 && rc < sizeof(buf1)) {
     env = buf1;
     variable = buf1;
   }
   if(do_expand && strchr(variable, '%')) {
     /* buf2 == variable if not expanded */
-    rc = ExpandEnvironmentStrings(variable, buf2, sizeof(buf2));
+    rc = ExpandEnvironmentStringsA(variable, buf2, sizeof(buf2));
     if(rc > 0 && rc < sizeof(buf2) &&
        !strchr(buf2, '%'))    /* no vars still unexpanded */
       env = buf2;
index 7cf11d8a4d4e65a0b2e3c20eec09db1537171a3c..14efc5c3aa2d31bb1db16182613ed3a9f14f8b8f 100644 (file)
@@ -79,7 +79,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
            * already declared via inclusions done in setup header file.
            * We assume that we are using the ASCII version here.
            */
-          int n = GetModuleFileName(0, filebuffer, sizeof(filebuffer));
+          int n = GetModuleFileNameA(0, filebuffer, sizeof(filebuffer));
           if(n > 0 && n < (int)sizeof(filebuffer)) {
             /* We got a valid filename - get the directory part */
             char *lastdirchar = strrchr(filebuffer, '\\');