summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2010-09-02 21:12:14 -0700
committerDan Fandrich <dan@coneharvesters.com>2010-09-02 21:12:14 -0700
commit6882ae8dee90ca35bcd5c5b5588a4018798e222b (patch)
tree5e5fde8dd89bcdc081eff9a3a54bd2247437bf22 /src
parenta00297158e881447deed870e4a8b9989893f15b2 (diff)
downloadcurl-6882ae8dee90ca35bcd5c5b5588a4018798e222b.tar.gz
Use checkprefix() to compare protocol-specific strings
Otherwise, there could be problems running in certain locales.
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index d428a7850..6332bf214 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1190,7 +1190,7 @@ static int formparse(struct Configurable *config,
while(ISSPACE(*ptr))
ptr++;
- if(curlx_strnequal("type=", ptr, 5)) {
+ if(checkprefix("type=", ptr)) {
/* set type pointer */
type = &ptr[5];
@@ -1210,7 +1210,7 @@ static int formparse(struct Configurable *config,
specified and if not we simply assume that it is text that
the user wants included in the type and include that too up
to the next zero or semicolon. */
- if((*sep==';') && !curlx_strnequal(";filename=", sep, 10)) {
+ if((*sep==';') && !checkprefix(";filename=", sep)) {
sep2 = strchr(sep+1, ';');
if (sep2)
sep = sep2;
@@ -1226,7 +1226,7 @@ static int formparse(struct Configurable *config,
else
ptr = NULL; /* end */
}
- else if(curlx_strnequal("filename=", ptr, 9)) {
+ else if(checkprefix("filename=", ptr)) {
filename = &ptr[9];
ptr=strchr(filename, FORM_TYPE_SEPARATOR);
if(!ptr) {
@@ -4404,7 +4404,7 @@ header_callback(void *ptr, size_t size, size_t nmemb, void *stream)
const char* end = (char*)ptr + cb;
size_t len;
- if (cb > 20 && curlx_strnequal(str, "Content-disposition:", 20)) {
+ if (cb > 20 && checkprefix("Content-disposition:", str)) {
char *p = (char*)str + 20;
/* look for the 'filename=' parameter
@@ -5072,7 +5072,7 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
my_setopt(curl, CURLOPT_READDATA, &input);
/* what call to read */
if ((outfile && !curlx_strequal("-", outfile)) ||
- !curlx_strnequal(url, "telnet:", 7))
+ !checkprefix("telnet:", url))
my_setopt(curl, CURLOPT_READFUNCTION, my_fread);
/* in 7.18.0, the CURLOPT_SEEKFUNCTION/DATA pair is taking over what
@@ -5465,7 +5465,7 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
char *this_url=NULL;
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &this_url);
if(this_url &&
- curlx_strnequal(this_url, "http", 4)) {
+ checkprefix("http", this_url)) {
/* This was HTTP(S) */
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response);