Fossil SCM
On Win32 isatty/fileno have been deprecated in favor of _isatty/_fileno.
Commit
594bbaea700ed2dd77495d0c211deadf509f2d09
Parent
e97665e0566ef29…
1 file changed
+7
-1
+7
-1
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -17,10 +17,16 @@ | ||
| 17 | 17 | ** |
| 18 | 18 | ** This file contains code for parsing URLs that appear on the command-line |
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "url.h" |
| 22 | +#include <stdio.h> | |
| 23 | +#ifdef _WIN32 | |
| 24 | +#include <io.h> | |
| 25 | +#define isatty(d) _isatty(d) | |
| 26 | +#define fileno(s) _fileno(s) | |
| 27 | +#endif | |
| 22 | 28 | |
| 23 | 29 | #if INTERFACE |
| 24 | 30 | /* |
| 25 | 31 | ** Flags for url_parse() |
| 26 | 32 | */ |
| @@ -472,10 +478,10 @@ | ||
| 472 | 478 | ** URL but no password. |
| 473 | 479 | */ |
| 474 | 480 | void url_get_password_if_needed(void){ |
| 475 | 481 | if( (g.urlUser && g.urlUser[0]) |
| 476 | 482 | && (g.urlPasswd==0 || g.urlPasswd[0]==0) |
| 477 | - && isatty(fileno(stdin)) | |
| 483 | + && isatty(fileno(stdin)) | |
| 478 | 484 | ){ |
| 479 | 485 | url_prompt_for_password(); |
| 480 | 486 | } |
| 481 | 487 | } |
| 482 | 488 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -17,10 +17,16 @@ | |
| 17 | ** |
| 18 | ** This file contains code for parsing URLs that appear on the command-line |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "url.h" |
| 22 | |
| 23 | #if INTERFACE |
| 24 | /* |
| 25 | ** Flags for url_parse() |
| 26 | */ |
| @@ -472,10 +478,10 @@ | |
| 472 | ** URL but no password. |
| 473 | */ |
| 474 | void url_get_password_if_needed(void){ |
| 475 | if( (g.urlUser && g.urlUser[0]) |
| 476 | && (g.urlPasswd==0 || g.urlPasswd[0]==0) |
| 477 | && isatty(fileno(stdin)) |
| 478 | ){ |
| 479 | url_prompt_for_password(); |
| 480 | } |
| 481 | } |
| 482 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -17,10 +17,16 @@ | |
| 17 | ** |
| 18 | ** This file contains code for parsing URLs that appear on the command-line |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "url.h" |
| 22 | #include <stdio.h> |
| 23 | #ifdef _WIN32 |
| 24 | #include <io.h> |
| 25 | #define isatty(d) _isatty(d) |
| 26 | #define fileno(s) _fileno(s) |
| 27 | #endif |
| 28 | |
| 29 | #if INTERFACE |
| 30 | /* |
| 31 | ** Flags for url_parse() |
| 32 | */ |
| @@ -472,10 +478,10 @@ | |
| 478 | ** URL but no password. |
| 479 | */ |
| 480 | void url_get_password_if_needed(void){ |
| 481 | if( (g.urlUser && g.urlUser[0]) |
| 482 | && (g.urlPasswd==0 || g.urlPasswd[0]==0) |
| 483 | && isatty(fileno(stdin)) |
| 484 | ){ |
| 485 | url_prompt_for_password(); |
| 486 | } |
| 487 | } |
| 488 |