aboutsummaryrefslogtreecommitdiff
path: root/lib/formdata.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-09-30 17:15:05 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-10-31 08:46:35 +0100
commit502acba2af821391b85a2cd4ac7b91ad8e9d4180 (patch)
treee219be1178db413bffd92033e965c1e1075c4702 /lib/formdata.c
parent1833a45dde4d27febfce42813699533b1ae993d1 (diff)
downloadgnurl-502acba2af821391b85a2cd4ac7b91ad8e9d4180.tar.gz
gnurl-502acba2af821391b85a2cd4ac7b91ad8e9d4180.tar.bz2
gnurl-502acba2af821391b85a2cd4ac7b91ad8e9d4180.zip
strcasecompare: is the new name for strequal()
... to make it less likely that we forget that the function actually does case insentive compares. Also replaced several invokes of the function with a plain strcmp when case sensitivity is not an issue (like comparing with "-").
Diffstat (limited to 'lib/formdata.c')
-rw-r--r--lib/formdata.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index ae75fe175..785f1a678 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -33,7 +33,7 @@
#include "urldata.h" /* for struct Curl_easy */
#include "formdata.h"
#include "vtls/vtls.h"
-#include "strequal.h"
+#include "strcase.h"
#include "sendf.h"
#include "strdup.h"
/* The last 3 #include files should be in this order */
@@ -201,9 +201,9 @@ static const char *ContentTypeForFilename(const char *filename,
if(filename) { /* in case a NULL was passed in */
for(i=0; i<sizeof(ctts)/sizeof(ctts[0]); i++) {
if(strlen(filename) >= strlen(ctts[i].extension)) {
- if(strequal(filename +
- strlen(filename) - strlen(ctts[i].extension),
- ctts[i].extension)) {
+ if(strcasecompare(filename +
+ strlen(filename) - strlen(ctts[i].extension),
+ ctts[i].extension)) {
contenttype = ctts[i].type;
break;
}
@@ -878,7 +878,7 @@ static CURLcode AddFormData(struct FormData **formp,
else {
/* Since this is a file to be uploaded here, add the size of the actual
file */
- if(!strequal("-", newform->line)) {
+ if(strcmp("-", newform->line)) {
struct_stat file;
if(!stat(newform->line, &file) && !S_ISDIR(file.st_mode))
*size += filesize(newform->line, file);
@@ -1305,7 +1305,7 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
/* we should include the contents from the specified file */
FILE *fileread;
- fileread = strequal("-", file->contents)?
+ fileread = !strcmp("-", file->contents)?
stdin:fopen(file->contents, "rb"); /* binary read for win32 */
/*