Hi,

Thanks a lot for the patch! Would you be willing to write a test case for it? 
The tests are  available in the testenv/ directory

On Fri, Feb 11, 2022, at 12:28, Jose Quaresma wrote:
> If the netrc have backslash char "\" it doesn't work with "wget"
> but the same netrc file works with "curl -n"
>
> - For example if the netrc password have a backslash on it the wget will 
> return:
>   Username/Password Authentication Failed.
>
> - The same password with the backslash works if the it is typed on the 
> stdin with:
>   wget uri --user=username --ask-password
>
> commit 2b2fd2924aa9eac8c831380196a13c427f6b4329, introduce quotation mark
> support and after that wget will remove the backslash char in every token
> on the netrc. The backslash can be removed but only when the presence of
> the quotation mark is detected.
>
> Signed-off-by: Jose Quaresma <[email protected]>
> ---
>  src/netrc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/netrc.c b/src/netrc.c
> index 76e52485..ab090256 100644
> --- a/src/netrc.c
> +++ b/src/netrc.c
> @@ -294,7 +294,7 @@ parse_netrc_fp (const char *path, FILE *fp)
> 
>            /* Find the end of the token, handling quotes and escapes.  */
>            while (*p && (qmark ? *p != '"' : !c_isspace (*p))){
> -            if (*p == '\\')
> +            if (qmark && *p == '\\')
>                shift_left (p);
>              p ++;
>            }
> -- 
> 2.35.1

Reply via email to