-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
curl: check for end of input in writeout backslash handling
Reported-by: Brian Carpenter Added test 1442 to verify
- Loading branch information
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | (__| |_| | _ <| |___ | ||
* \___|\___/|_| \_\_____| | ||
* | ||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <[email protected]>, et al. | ||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <[email protected]>, et al. | ||
* | ||
* This software is licensed as described in the file COPYING, which | ||
* you should have received as part of this distribution. The terms | ||
|
@@ -341,7 +341,7 @@ void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo) | |
} | ||
} | ||
} | ||
else if('\\' == *ptr) { | ||
else if('\\' == *ptr && ptr[1]) { | ||
switch(ptr[1]) { | ||
case 'r': | ||
fputc('\r', stream); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<testcase> | ||
<info> | ||
<keywords> | ||
--write-out | ||
FILE | ||
</keywords> | ||
</info> | ||
# Server-side | ||
<reply> | ||
</reply> | ||
|
||
# Client-side | ||
<client> | ||
<server> | ||
file | ||
</server> | ||
|
||
<name> | ||
Check --write-out with trailing \ | ||
</name> | ||
<command> | ||
file://localhost/%PWD/log/non-existent-file.txt --write-out '\' | ||
</command> | ||
</client> | ||
|
||
# Verify data | ||
<verify> | ||
<errorcode> | ||
37 | ||
</errorcode> | ||
<stdout nonewline="yes"> | ||
\ | ||
</stdout> | ||
</verify> | ||
</testcase> |