]> granicus.if.org Git - curl/commitdiff
netrc: Read in text mode when cygwin
authorOrgad Shaneh <orgads@gmail.com>
Wed, 6 May 2015 06:33:57 +0000 (02:33 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Wed, 6 May 2015 06:34:31 +0000 (02:34 -0400)
Use text mode when cygwin to eliminate trailing carriage returns.

Bug: https://github.com/bagder/curl/pull/258

lib/netrc.c

index e656cf7c6d99642ea95399b9d92f7ca4c35ec706..97a07b88e2da8d1c1d868d5618b0871c4b68cf85 100644 (file)
@@ -109,7 +109,11 @@ int Curl_parsenetrc(const char *host,
     netrc_alloc = TRUE;
   }
 
+#ifdef __CYGWIN__
+  file = fopen(netrcfile, "rt");
+#else
   file = fopen(netrcfile, "r");
+#endif
   if(netrc_alloc)
     free(netrcfile);
   if(file) {