cURL / Mailing Lists / curl-users / Single Mail

curl-users

proposed patch for windows for using _netrc

From: Cesar Romani <cesar.romani_at_gmail.com>
Date: Tue, 10 Apr 2012 22:48:32 -0500

On Windows normally you don't have a HOME environment variable, but you
have USERPROFILE, available in all versions of windows.
The following patch take this into account:

--------------------
--- ./lib/netrc.c.org 2012-04-03 19:14:56 -0500
+++ ./lib/netrc.c 2012-04-03 19:15:50 -0500
@@ -81,6 +81,8 @@

    if(!netrcfile) {
      home = curl_getenv("HOME"); /* portable environment reader */
+ if(!home)
+ home = curl_getenv("USERPROFILE");
      if(home) {
        home_alloc = TRUE;
  #if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
--------------------

Regards,

-- 
Cesar
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-11