Commit 502acba2 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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 "-").
parent 1833a45d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ LIB_VTLS_HFILES = vtls/openssl.h vtls/vtls.h vtls/gtls.h \
LIB_CFILES = file.c timeval.c base64.c hostip.c progress.c formdata.c   \
  cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c       \
  ldap.c version.c getenv.c escape.c mprintf.c telnet.c netrc.c         \
  getinfo.c transfer.c strequal.c easy.c security.c curl_fnmatch.c      \
  getinfo.c transfer.c strcase.c easy.c security.c curl_fnmatch.c       \
  fileinfo.c ftplistparser.c wildcard.c krb5.c memdebug.c http_chunks.c \
  strtok.c connect.c llist.c hash.c multi.c content_encoding.c share.c  \
  http_digest.c md4.c md5.c http_negotiate.c inet_pton.c strtoofft.c    \
@@ -58,7 +58,7 @@ LIB_CFILES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
LIB_HFILES = arpa_telnet.h netrc.h file.h timeval.h hostip.h progress.h \
  formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h if2ip.h         \
  speedcheck.h urldata.h curl_ldap.h escape.h telnet.h getinfo.h        \
  strequal.h curl_sec.h memdebug.h http_chunks.h curl_fnmatch.h         \
  strcase.h curl_sec.h memdebug.h http_chunks.h curl_fnmatch.h          \
  wildcard.h fileinfo.h ftplistparser.h strtok.h connect.h llist.h      \
  hash.h content_encoding.h share.h curl_md4.h curl_md5.h http_digest.h \
  http_negotiate.h inet_pton.h amigaos.h strtoofft.h strerror.h         \
+2 −3
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@ Example set of cookies:

#include "urldata.h"
#include "cookie.h"
#include "strequal.h"
#include "strtok.h"
#include "sendf.h"
#include "slist.h"
@@ -939,7 +938,7 @@ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
  }
  c->running = FALSE; /* this is not running, this is init */

  if(file && strequal(file, "-")) {
  if(file && !strcmp(file, "-")) {
    fp = stdin;
    fromfile=FALSE;
  }
@@ -1310,7 +1309,7 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
  /* at first, remove expired cookies */
  remove_expired(c);

  if(strequal("-", dumphere)) {
  if(!strcmp("-", dumphere)) {
    /* use stdout */
    out = stdout;
    use_stdout=TRUE;
+1 −2
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@
#include "curl_sasl.h"
#include "warnless.h"
#include "strtok.h"
#include "strequal.h"
#include "rawstr.h"
#include "sendf.h"
#include "non-ascii.h" /* included for Curl_convert_... prototypes */
@@ -159,7 +158,7 @@ CURLcode Curl_sasl_parse_url_auth_option(struct SASL *sasl,
    sasl->prefmech = SASL_AUTH_NONE;
  }

  if(strnequal(value, "*", len))
  if(!strncmp(value, "*", len))
    sasl->prefmech = SASL_AUTH_DEFAULT;
  else {
    mechbit = Curl_sasl_decode_mech(value, len, &mechlen);
+5 −5
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
@@ -34,8 +34,8 @@
   functions while they still are offered publicly. They will be made library-
   private one day */

#include "strequal.h"
/* "strequal.h" provides the strequal protos */
#include "strcase.h"
/* "strcase.h" provides the strcasecompare protos */

#include "strtoofft.h"
/* "strtoofft.h" provides this function: curlx_strtoofft(), returns a
@@ -73,8 +73,8 @@
*/

#define curlx_getenv curl_getenv
#define curlx_strequal curl_strequal
#define curlx_strnequal curl_strnequal
#define curlx_strcasecompare curl_strcasecompare
#define curlx_strncasecompare curl_strncasecompare
#define curlx_raw_equal Curl_raw_equal
#define curlx_mvsnprintf curl_mvsnprintf
#define curlx_msnprintf curl_msnprintf
+0 −1
Original line number Diff line number Diff line
@@ -54,7 +54,6 @@
#include "sendf.h"
#include "escape.h"
#include "progress.h"
#include "strequal.h"
#include "dict.h"
#include "rawstr.h"
#include "curl_memory.h"
Loading