cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/src ChangeLog add.c admin.c checkout.c cli...


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/src ChangeLog add.c admin.c checkout.c cli...
Date: Wed, 12 Sep 2007 18:27:09 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     07/09/12 18:27:08

Modified files:
        src            : ChangeLog add.c admin.c checkout.c client.c 
                         commit.c create_adm.c cvsrc.c edit.c entries.c 
                         fileattr.c find_names.c history.c ignore.c 
                         lock.c logmsg.c parseinfo.c patch.c rcs.c 
                         repos.c root.c server.c subr.c subr.h update.c 
                         watch.c 

Log message:
        * subr.h (STRNEQ): New macro.
        * add.c, admin.c, checkout.c, client.c, commit.c, create_adm.c,
        cvsrc.c, edit.c, entries.c, fileattr.c, find_names.c, history.c,
        ignore.c, lock.c, logmsg.c, parseinfo.c, patch.c, rcs.c, repos.c,
        root.c, server.c, subr.c, update.c, watch.c: Use STRNEQ.  Some
        cleanup.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3540&r2=1.3541
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/add.c?cvsroot=cvs&r1=1.133&r2=1.134
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/admin.c?cvsroot=cvs&r1=1.120&r2=1.121
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/checkout.c?cvsroot=cvs&r1=1.150&r2=1.151
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/client.c?cvsroot=cvs&r1=1.466&r2=1.467
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/commit.c?cvsroot=cvs&r1=1.276&r2=1.277
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/create_adm.c?cvsroot=cvs&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/cvsrc.c?cvsroot=cvs&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/edit.c?cvsroot=cvs&r1=1.101&r2=1.102
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/entries.c?cvsroot=cvs&r1=1.73&r2=1.74
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/fileattr.c?cvsroot=cvs&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/find_names.c?cvsroot=cvs&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/history.c?cvsroot=cvs&r1=1.102&r2=1.103
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ignore.c?cvsroot=cvs&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/lock.c?cvsroot=cvs&r1=1.124&r2=1.125
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/logmsg.c?cvsroot=cvs&r1=1.110&r2=1.111
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/parseinfo.c?cvsroot=cvs&r1=1.92&r2=1.93
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/patch.c?cvsroot=cvs&r1=1.112&r2=1.113
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/rcs.c?cvsroot=cvs&r1=1.388&r2=1.389
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/repos.c?cvsroot=cvs&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/root.c?cvsroot=cvs&r1=1.129&r2=1.130
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/server.c?cvsroot=cvs&r1=1.480&r2=1.481
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/subr.c?cvsroot=cvs&r1=1.161&r2=1.162
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/subr.h?cvsroot=cvs&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/update.c?cvsroot=cvs&r1=1.275&r2=1.276
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/watch.c?cvsroot=cvs&r1=1.49&r2=1.50

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3540
retrieving revision 1.3541
diff -u -b -r1.3540 -r1.3541
--- ChangeLog   12 Sep 2007 17:27:21 -0000      1.3540
+++ ChangeLog   12 Sep 2007 18:27:06 -0000      1.3541
@@ -1,5 +1,12 @@
 2007-09-12  Derek Price  <address@hidden>
 
+       * subr.h (STRNEQ): New macro.
+       * add.c, admin.c, checkout.c, client.c, commit.c, create_adm.c,
+       cvsrc.c, edit.c, entries.c, fileattr.c, find_names.c, history.c,
+       ignore.c, lock.c, logmsg.c, parseinfo.c, patch.c, rcs.c, repos.c,
+       root.c, server.c, subr.c, update.c, watch.c: Use STRNEQ.  Some
+       cleanup.
+
        * subr.h (STREQ): New macro.
        * add.c, admin.c, annotate.c, base.c, checkin.c, checkout.c,
        classify.c, client.c, commit.c, create_adm.c, diff.c, edit.c,

Index: add.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/add.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -b -r1.133 -r1.134
--- add.c       12 Sep 2007 17:27:21 -0000      1.133
+++ add.c       12 Sep 2007 18:27:06 -0000      1.134
@@ -256,11 +256,11 @@
                repository = Name_Repository (NULL, update_dir);
 
                /* don't add stuff to Emptydir */
-               if (strncmp (repository, current_parsed_root->directory, 
cvsroot_len) == 0
+               if (STRNEQ (repository, current_parsed_root->directory,
+                           cvsroot_len)
                    && ISSLASH (repository[cvsroot_len])
-                   && strncmp (repository + cvsroot_len + 1,
-                               CVSROOTADM,
-                               sizeof CVSROOTADM - 1) == 0
+                   && STRNEQ (repository + cvsroot_len + 1, CVSROOTADM,
+                              sizeof CVSROOTADM - 1)
                    && ISSLASH (repository[cvsroot_len + sizeof CVSROOTADM])
                    && STREQ (repository + cvsroot_len + sizeof CVSROOTADM + 1,
                               CVSNULLREPOS))
@@ -356,12 +356,11 @@
        repository = Name_Repository (NULL, finfo.update_dir);
 
        /* don't add stuff to Emptydir */
-       if (strncmp (repository, current_parsed_root->directory,
-                    cvsroot_len) == 0
+       if (STRNEQ (repository, current_parsed_root->directory,
+                    cvsroot_len)
            && ISSLASH (repository[cvsroot_len])
-           && strncmp (repository + cvsroot_len + 1,
-                       CVSROOTADM,
-                       sizeof CVSROOTADM - 1) == 0
+           && STRNEQ (repository + cvsroot_len + 1, CVSROOTADM,
+                      sizeof CVSROOTADM - 1)
            && ISSLASH (repository[cvsroot_len + sizeof CVSROOTADM])
            && STREQ (repository + cvsroot_len + sizeof CVSROOTADM + 1,
                      CVSNULLREPOS))

Index: admin.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/admin.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -b -r1.120 -r1.121
--- admin.c     12 Sep 2007 17:27:21 -0000      1.120
+++ admin.c     12 Sep 2007 18:27:06 -0000      1.121
@@ -305,7 +305,7 @@
 
            for (found = long_options; found->name; found++)
                if (len == strlen (found->name)
-                   && !strncmp (cur_opt, found->name, len))
+                   && STRNEQ (cur_opt, found->name, len))
                    break;
 
            if (found->name)
@@ -376,9 +376,9 @@
        char *arg = argv[i];
        if (i == 0)
        {
-           if (strncmp (argv[i], "cvs server", 10) == 0)
+           if (STRNEQ (argv[i], "cvs server", 10))
                arg = "admin";
-           else if (strncmp (argv[i], "cvs ", 4) == 0)
+           else if (STRNEQ (argv[i], "cvs ", 4))
                arg = argv[i] + 4;
        }
 

Index: checkout.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/checkout.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -b -r1.150 -r1.151
--- checkout.c  12 Sep 2007 17:27:21 -0000      1.150
+++ checkout.c  12 Sep 2007 18:27:06 -0000      1.151
@@ -531,7 +531,7 @@
 
     hardpath_len = strlen (hardpath);
     if (strlen (current) >= hardpath_len
-       && strncmp (current, hardpath, hardpath_len) == 0)
+       && STRNEQ (current, hardpath, hardpath_len))
     {
        if (/* Current is a subdirectory of hardpath.  */
            current[hardpath_len] == '/'
@@ -831,8 +831,8 @@
        struct dir_to_build *head;
        char *reposcopy;
 
-       if (strncmp (repository, current_parsed_root->directory,
-                    strlen (current_parsed_root->directory)) != 0)
+       if (!STRNEQ (repository, current_parsed_root->directory,
+                    strlen (current_parsed_root->directory)))
            error (1, 0, "\
 internal error: %s doesn't start with %s in checkout_proc",
                   repository, current_parsed_root->directory);

Index: client.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/client.c,v
retrieving revision 1.466
retrieving revision 1.467
diff -u -b -r1.466 -r1.467
--- client.c    12 Sep 2007 17:27:21 -0000      1.466
+++ client.c    12 Sep 2007 18:27:06 -0000      1.467
@@ -693,7 +693,7 @@
 {
     const char *questionable = closure;
     const char *prefix = p->key;
-    if (strncmp (prefix, questionable, strlen (prefix))) return 0;
+    if (!STRNEQ (prefix, questionable, strlen (prefix))) return 0;
     questionable += strlen (prefix);
     while (ISSLASH (*questionable)) questionable++;
     if (*questionable == '\0') return 1;
@@ -786,7 +786,7 @@
     assert (reposname);
 
     reposdirname_absolute = 0;
-    if (strncmp (reposname, toplevel_repos, strlen (toplevel_repos)))
+    if (!STRNEQ (reposname, toplevel_repos, strlen (toplevel_repos)))
     {
        reposdirname_absolute = 1;
        short_repos = reposname;
@@ -4162,7 +4162,7 @@
        
        len = read_line (&cmd);
        for (rs = responses; rs->name; ++rs)
-           if (!strncmp (cmd, rs->name, strlen (rs->name)))
+           if (STRNEQ (cmd, rs->name, strlen (rs->name)))
            {
                size_t cmdlen = strlen (rs->name);
                if (cmd[cmdlen] == '\0')
@@ -4704,13 +4704,13 @@
                }
                exit (EXIT_FAILURE);
            }
-           else if (!strncmp (read_buf, "E ", 2))
+           else if (STRNEQ (read_buf, "E ", 2))
            {
                fprintf (stderr, "%s\n", read_buf + 2);
 
                /* Continue with the authentication protocol.  */
            }
-           else if (!strncmp (read_buf, "error ", 6))
+           else if (STRNEQ (read_buf, "error ", 6))
            {
                char *p;
 
@@ -4978,7 +4978,7 @@
            {
                if (suppress_redirect && STREQ (rs->name, "Redirect"))
                    continue;
-               if (suppress_bases && !strncmp (rs->name, "Base-", 5))
+               if (suppress_bases && STRNEQ (rs->name, "Base-", 5))
                    continue;
                if (suppress_bases && STREQ (rs->name, "OpenPGP-signature"))
                    continue;
@@ -6065,7 +6065,7 @@
 
     assert (toplevel_repos);
 
-    if (strncmp (repository, toplevel_repos, strlen (toplevel_repos)))
+    if (!STRNEQ (repository, toplevel_repos, strlen (toplevel_repos)))
        error (1, 0,
               "internal error: pathname `%s' doesn't specify file in `%s'",
               repository, toplevel_repos);

Index: commit.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/commit.c,v
retrieving revision 1.276
retrieving revision 1.277
diff -u -b -r1.276 -r1.277
--- commit.c    12 Sep 2007 17:27:22 -0000      1.276
+++ commit.c    12 Sep 2007 18:27:07 -0000      1.277
@@ -845,14 +845,12 @@
        return 1;
     }
 
-    if (strncmp (finfo->repository, current_parsed_root->directory,
-                 cvsroot_len) == 0
+    if (STRNEQ (finfo->repository, current_parsed_root->directory, cvsroot_len)
        && ISSLASH (finfo->repository[cvsroot_len])
-       && strncmp (finfo->repository + cvsroot_len + 1,
-                   CVSROOTADM,
-                   sizeof (CVSROOTADM) - 1) == 0
-       && ISSLASH (finfo->repository[cvsroot_len + sizeof (CVSROOTADM)])
-       && STREQ (finfo->repository + cvsroot_len + sizeof (CVSROOTADM) + 1,
+       && STRNEQ (finfo->repository + cvsroot_len + 1, CVSROOTADM,
+                  sizeof CVSROOTADM - 1)
+       && ISSLASH (finfo->repository[cvsroot_len + sizeof CVSROOTADM])
+       && STREQ (finfo->repository + cvsroot_len + sizeof CVSROOTADM + 1,
                  CVSNULLREPOS)
        )
        error (1, 0, "cannot check in to %s", finfo->repository);
@@ -1637,8 +1635,8 @@
     {
        const char *p;
 
-       if (strncmp (current_parsed_root->directory, repository,
-                    strlen (current_parsed_root->directory)) != 0)
+       if (!STRNEQ (current_parsed_root->directory, repository,
+                    strlen (current_parsed_root->directory)))
            error (0, 0,
                 "internal error: repository (%s) doesn't begin with root (%s)",
                   repository, current_parsed_root->directory);
@@ -1648,7 +1646,7 @@
        if (STREQ ("CVSROOT", p)
            /* Check for subdirectories because people may want to create
               subdirectories and list files therein in checkoutlist.  */
-           || strncmp ("CVSROOT/", p, strlen ("CVSROOT/")) == 0
+           || STRNEQ ("CVSROOT/", p, strlen ("CVSROOT/"))
            )
        {
            /* "Database" might a little bit grandiose and/or vague,

Index: create_adm.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/create_adm.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- create_adm.c        12 Sep 2007 17:27:22 -0000      1.55
+++ create_adm.c        12 Sep 2007 18:27:07 -0000      1.56
@@ -109,7 +109,7 @@
      */
     {
        char *path = Xasprintf ("%s/", current_parsed_root->directory);
-       if (strncmp (cp, path, strlen (path)) == 0)
+       if (STRNEQ (cp, path, strlen (path)))
            cp += strlen (path);
        free (path);
     }

Index: cvsrc.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/cvsrc.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- cvsrc.c     27 Aug 2007 02:11:05 -0000      1.33
+++ cvsrc.c     12 Sep 2007 18:27:07 -0000      1.34
@@ -101,7 +101,7 @@
            continue;
 
        /* stop if we match the current command */
-       if (!strncmp (line, cmdname, command_len)
+       if (STRNEQ (line, cmdname, command_len)
            && isspace ((unsigned char) *(line + command_len)))
        {
            found = 1;

Index: edit.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/edit.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -b -r1.101 -r1.102
--- edit.c      12 Sep 2007 17:27:22 -0000      1.101
+++ edit.c      12 Sep 2007 18:27:07 -0000      1.102
@@ -987,7 +987,7 @@
            break;
        nextp = strchr (p, ',');
 
-       if ((size_t)(endp - p) == strlen (who) && strncmp (who, p, endp - p) == 
0)
+       if ((size_t)(endp - p) == strlen (who) && STRNEQ (who, p, endp - p))
        {
            /* Don't notify user of their own changes.  Would perhaps
               be better to check whether it is the same working
@@ -1016,34 +1016,34 @@
 
            /* If there is a temporary and a regular watch, send a single
               notification, for the regular watch.  */
-           if (type == 'E' && endq - q == 4 && strncmp ("edit", q, 4) == 0)
+           if (type == 'E' && endq - q == 4 && STRNEQ ("edit", q, 4))
            {
                notif = "edit";
            }
            else if (type == 'U'
-                    && endq - q == 6 && strncmp ("unedit", q, 6) == 0)
+                    && endq - q == 6 && STRNEQ ("unedit", q, 6))
            {
                notif = "unedit";
            }
            else if (type == 'C'
-                    && endq - q == 6 && strncmp ("commit", q, 6) == 0)
+                    && endq - q == 6 && STRNEQ ("commit", q, 6))
            {
                notif = "commit";
            }
            else if (type == 'E'
-                    && endq - q == 5 && strncmp ("tedit", q, 5) == 0)
+                    && endq - q == 5 && STRNEQ ("tedit", q, 5))
            {
                if (notif == NULL)
                    notif = "temporary edit";
            }
            else if (type == 'U'
-                    && endq - q == 7 && strncmp ("tunedit", q, 7) == 0)
+                    && endq - q == 7 && STRNEQ ("tunedit", q, 7))
            {
                if (notif == NULL)
                    notif = "temporary unedit";
            }
            else if (type == 'C'
-                    && endq - q == 7 && strncmp ("tcommit", q, 7) == 0)
+                    && endq - q == 7 && STRNEQ ("tcommit", q, 7))
            {
                if (notif == NULL)
                    notif = "temporary commit";
@@ -1072,8 +1072,7 @@
            {
                while (getline (&line, &line_len, fp) >= 0)
                {
-                   if (strncmp (line, p, len) == 0
-                       && line[len] == ':')
+                   if (STRNEQ (line, p, len) && line[len] == ':')
                    {
                        char *cp;
                        args.notifyee = xstrdup (line + len + 1);

Index: entries.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/entries.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -b -r1.73 -r1.74
--- entries.c   12 Sep 2007 17:27:22 -0000      1.73
+++ entries.c   12 Sep 2007 18:27:07 -0000      1.74
@@ -616,7 +616,7 @@
                /* Fix non-standard format.  */
                if (c[8] == '0') c[8] = ' ';
 
-               if (!strncmp (ts + 25, c, 24))
+               if (STRNEQ (ts + 25, c, 24))
                    ts = time_stamp (user);
                else
                {

Index: fileattr.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/fileattr.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- fileattr.c  27 Aug 2007 02:11:05 -0000      1.39
+++ fileattr.c  12 Sep 2007 18:27:07 -0000      1.40
@@ -205,8 +205,7 @@
     }
     while (p)
     {
-       if (strncmp (attrname, p, attrname_len) == 0
-           && p[attrname_len] == '=')
+       if (STRNEQ (attrname, p, attrname_len) && p[attrname_len] == '=')
        {
            /* Found it.  */
            return p + attrname_len + 1;
@@ -277,7 +276,7 @@
            }
            else
                ++p2;
-           if (strncmp (attrname, p, attrname_len) == 0
+           if (STRNEQ (attrname, p, attrname_len)
                && p[attrname_len] == namevalsep)
            {
                /* Found it.  */

Index: find_names.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/find_names.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- find_names.c        12 Sep 2007 17:27:22 -0000      1.49
+++ find_names.c        12 Sep 2007 18:27:07 -0000      1.50
@@ -241,7 +241,8 @@
        Emptydir.  Except in the CVSNULLREPOS case, Emptydir is just
        a normal directory name.  */
     if (ISABSOLUTE (dir)
-       && strncmp (dir, current_parsed_root->directory, strlen 
(current_parsed_root->directory)) == 0
+       && STRNEQ (dir, current_parsed_root->directory,
+                  strlen (current_parsed_root->directory))
        && ISSLASH (dir[strlen (current_parsed_root->directory)])
        && STREQ (dir + strlen (current_parsed_root->directory) + 1,
                  CVSROOTADM))

Index: history.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/history.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -b -r1.102 -r1.103
--- history.c   12 Sep 2007 17:27:22 -0000      1.102
+++ history.c   12 Sep 2007 18:27:07 -0000      1.103
@@ -843,7 +843,7 @@
        {
            /* Assumes neither CurDir nor pwdir ends in '/' */
            i = strlen (pwdir);
-           if (!strncmp (CurDir, pwdir, i))
+           if (STRNEQ (CurDir, pwdir, i))
            {
                PrCurDir += i;          /* Point to '/' separator */
                tilde = "~";
@@ -867,7 +867,7 @@
                free_cwd (&cwd);
 
                i = strlen (homedir);
-               if (!strncmp (CurDir, homedir, i))
+               if (STRNEQ (CurDir, homedir, i))
                {
                    PrCurDir += i;      /* Point to '/' separator */
                    tilde = "~";
@@ -1326,7 +1326,7 @@
        if (!(string = strchr (string, c)))
            return 0;
        string++;
-       if (!strncmp (find, string, len))
+       if (STRNEQ (find, string, len))
            return 1;
     }
     return 0;
@@ -1486,7 +1486,7 @@
                {
                    cp++;
                    /* if argument to -p is a prefix of repository */
-                   if (!strncmp (cp, hr->repos, strlen (cp)))
+                   if (STRNEQ (cp, hr->repos, strlen (cp)))
                    {
                        hr->mod = fl->l_module;
                        break;

Index: ignore.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ignore.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- ignore.c    12 Sep 2007 17:27:22 -0000      1.61
+++ ignore.c    12 Sep 2007 18:27:07 -0000      1.62
@@ -352,7 +352,7 @@
     i = dir_ign_current;
     while (i--)
     {
-       if (strncmp (name, dir_ign_list[i], strlen (dir_ign_list[i])+1) == 0)
+       if (STRNEQ (name, dir_ign_list[i], strlen (dir_ign_list[i])+1))
            return 1;
     }
 

Index: lock.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/lock.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -b -r1.124 -r1.125
--- lock.c      12 Sep 2007 17:27:22 -0000      1.124
+++ lock.c      12 Sep 2007 18:27:07 -0000      1.125
@@ -205,8 +205,8 @@
           to CVSROOT.  */
        assert (current_parsed_root != NULL);
        assert (current_parsed_root->directory != NULL);
-       assert (strncmp (repository, current_parsed_root->directory,
-                        strlen (current_parsed_root->directory)) == 0);
+       assert (STRNEQ (repository, current_parsed_root->directory,
+                       strlen (current_parsed_root->directory)));
        short_repos = repository + strlen (current_parsed_root->directory) + 1;
 
        if (STREQ (repository, current_parsed_root->directory))

Index: logmsg.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/logmsg.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- logmsg.c    12 Sep 2007 17:27:23 -0000      1.110
+++ logmsg.c    12 Sep 2007 18:27:07 -0000      1.111
@@ -340,7 +340,7 @@
                    error (0, errno, "warning: cannot read %s", fname);
                break;
            }
-           if (strncmp (line, CVSEDITPREFIX, CVSEDITPREFIXLEN) == 0)
+           if (STRNEQ (line, CVSEDITPREFIX, CVSEDITPREFIXLEN))
                continue;
            if (offset + line_length >= message_len)
                expand_string (messagep, &message_len,
@@ -519,7 +519,7 @@
                        error (1, errno, "cannot read %s", data.fname);
                    break;
                }
-               if (strncmp (line, CVSEDITPREFIX, CVSEDITPREFIXLEN) == 0)
+               if (STRNEQ (line, CVSEDITPREFIX, CVSEDITPREFIXLEN))
                    continue;
                (void) strcpy (p, line);
                p += line_length;

Index: parseinfo.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/parseinfo.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -b -r1.92 -r1.93
--- parseinfo.c 12 Sep 2007 17:27:23 -0000      1.92
+++ parseinfo.c 12 Sep 2007 18:27:07 -0000      1.93
@@ -447,7 +447,7 @@
 
            if (!isreadable (*prefix)) continue;
            nprefix = xcanonicalize_file_name (*prefix);
-           if (!strncmp (nprefix, npath, strlen (nprefix))
+           if (STRNEQ (nprefix, npath, strlen (nprefix))
                && (((*prefix)[strlen (*prefix)] != '/'
                     && strlen (npath) == strlen (nprefix))
                    || ((*prefix)[strlen (*prefix)] == '/'

Index: patch.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/patch.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -b -r1.112 -r1.113
--- patch.c     12 Sep 2007 17:27:23 -0000      1.112
+++ patch.c     12 Sep 2007 18:27:07 -0000      1.113
@@ -617,10 +617,10 @@
            }
            if (!unidiff)
            {
-               if (strncmp (line1, "*** ", 4) != 0 ||
-                   strncmp (line2, "--- ", 4) != 0 ||
-                   (cp1 = strchr (line1, '\t')) == NULL ||
-                   (cp2 = strchr (line2, '\t')) == NULL)
+               if (!STRNEQ (line1, "*** ", 4)
+                   || !STRNEQ (line2, "--- ", 4)
+                   || !(cp1 = strchr (line1, '\t'))
+                   || !(cp2 = strchr (line2, '\t')))
                {
                    error (0, 0, "invalid diff header for %s", rcs);
                    ret = 1;
@@ -631,10 +631,10 @@
            }
            else
            {
-               if (strncmp (line1, "--- ", 4) != 0 ||
-                   strncmp (line2, "+++ ", 4) != 0 ||
-                   (cp1 = strchr (line1, '\t')) == NULL ||
-                   (cp2 = strchr  (line2, '\t')) == NULL)
+               if (!STRNEQ (line1, "--- ", 4)
+                   || !STRNEQ (line2, "+++ ", 4)
+                   || !(cp1 = strchr (line1, '\t'))
+                   || !(cp2 = strchr  (line2, '\t')))
                {
                    error (0, 0, "invalid unidiff header for %s", rcs);
                    ret = 1;
@@ -648,7 +648,7 @@
 
            strippath = Xasprintf ("%s/", current_parsed_root->directory);
 
-           if (strncmp (rcs, strippath, strlen (strippath)) == 0)
+           if (STRNEQ (rcs, strippath, strlen (strippath)))
                rcs += strlen (strippath);
            free (strippath);
            if (vers_tag != NULL)

Index: rcs.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/rcs.c,v
retrieving revision 1.388
retrieving revision 1.389
diff -u -b -r1.388 -r1.389
--- rcs.c       12 Sep 2007 17:27:23 -0000      1.388
+++ rcs.c       12 Sep 2007 18:27:07 -0000      1.389
@@ -1,7 +1,8 @@
 /*
- * Copyright (C) 1986-2006 The Free Software Foundation, Inc.
+ * Copyright (C) 1986-2007 The Free Software Foundation, Inc.
  *
- * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * Portions Copyright (C) 1998-2007 Derek Price,
+ *                                  Ximbiot LLC <http://ximbiot.com>,
  *                                  and others.
  *
  * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
@@ -581,7 +582,7 @@
        /* Note that when comparing with RCSDATE, we are not massaging
            VALUE from the string found in the RCS file.  This is OK
            since we know exactly what to expect.  */
-       if (*cp == '\0' && strncmp (RCSDATE, value, (sizeof RCSDATE) - 1) == 0)
+       if (!*cp && STRNEQ (RCSDATE, value, sizeof RCSDATE - 1))
            break;
 
        if (STREQ (key, RCSDESC))
@@ -735,7 +736,7 @@
        strncpy (newpath, rcs->path, p - rcs->path - 1);
        newpath[p - rcs->path - 1] = '\0';
        q = newpath + (p - rcs->path - 1) - (sizeof CVSATTIC - 1);
-       assert (strncmp (q, CVSATTIC, sizeof CVSATTIC - 1) == 0);
+       assert (STRNEQ (q, CVSATTIC, sizeof CVSATTIC - 1));
        strcpy (q, p);
 
        if (CVS_RENAME (rcs->path, newpath) < 0)
@@ -2381,7 +2382,7 @@
                /* see if we have .magic-branch. (".0.") */
                magic = xmalloc (strlen (tag) + 1);
                (void) sprintf (magic, ".%d.", RCS_MAGIC_BRANCH);
-               if (strncmp (magic, cp, strlen (magic)) == 0)
+               if (STRNEQ (magic, cp, strlen (magic)))
                {
                    /* it's magic.  See if the branch exists */
                    *cp = '\0';         /* turn it into a revision */
@@ -2618,7 +2619,7 @@
 
        /* see if we have .magic-branch. (".0.") */
        magic = Xasprintf (".%d.", RCS_MAGIC_BRANCH);
-       if (strncmp (magic, cp, strlen (magic)) == 0)
+       if (STRNEQ (magic, cp, strlen (magic)))
        {
            free (magic);
            free (version);
@@ -2666,7 +2667,7 @@
        /* see if we have .magic-branch. (".0.") */
        magic = xmalloc (strlen (version) + 1);
        (void) sprintf (magic, ".%d.", RCS_MAGIC_BRANCH);
-       if (strncmp (magic, cp, strlen (magic)) == 0)
+       if (STRNEQ (magic, cp, strlen (magic)))
        {
            /* yep.  it's magic.  now, construct the real branch */
            *cp = '\0';                 /* turn it into a revision */
@@ -2711,7 +2712,7 @@
        xtag = Xasprintf ("%s.", tag);
        for (cp = rcs->head; cp != NULL;)
        {
-           if (strncmp (xtag, cp, strlen (xtag)) == 0)
+           if (STRNEQ (xtag, cp, strlen (xtag)))
                break;
            p = findnode (rcs->versions, cp);
            if (p == NULL)
@@ -2761,7 +2762,7 @@
     xtag = Xasprintf ("%s.", tag);
     head = vn->branches->list;
     for (p = head->next; p != head; p = p->next)
-       if (strncmp (p->key, xtag, strlen (xtag)) == 0)
+       if (STRNEQ (p->key, xtag, strlen (xtag)))
            break;
     free (xtag);
 
@@ -2892,7 +2893,7 @@
           found our branch point if the first BRANCHLEN characters
           of the revision number match, *and* if the following
           character is a dot. */
-       if (strncmp (vp->key, branch, brlen) == 0 && vp->key[brlen] == '.')
+       if (STRNEQ (vp->key, branch, brlen) && vp->key[brlen] == '.')
            break;
        vp = vp->next;
     }
@@ -3087,7 +3088,7 @@
     /* walk the branches list looking for the branch number */
     xbranch = Xasprintf ("%s.", branch);
     for (p = vers->branches->list->next; p != vers->branches->list; p = 
p->next)
-       if (strncmp (p->key, xbranch, strlen (xbranch)) == 0)
+       if (STRNEQ (p->key, xbranch, strlen (xbranch)))
            break;
     free (xbranch);
     if (p == vers->branches->list)
@@ -3304,7 +3305,7 @@
        {
            if (cp == last) break;
            if ((cp == rcs->symbols_data || whitespace (cp[-1]))
-               && strncmp (cp, tag, len) == 0
+               && STRNEQ (cp, tag, len)
                && cp[len] == ':')
            {
                char *v, *r;
@@ -3706,7 +3707,7 @@
        {
            if (keyword->expandit
                && keyword->len == slen
-               && !strncmp (keyword->string, srch, slen))
+               && STRNEQ (keyword->string, srch, slen))
            {
                break;
            }
@@ -3948,8 +3949,8 @@
        if (keyword->expandto == KEYWORD_LOG
            && (sizeof "checked in with -k by " <= loglen
                || log == NULL
-               || strncmp (log, "checked in with -k by ",
-                           sizeof "checked in with -k by " - 1) != 0))
+               || !STRNEQ (log, "checked in with -k by ",
+                           sizeof "checked in with -k by " - 1)))
        {
            char *start;
            char *leader;
@@ -5410,7 +5411,7 @@
        assert (rcs->path);
        workfile = xstrdup (last_component (rcs->path));
        p = workfile + (strlen (workfile) - extlen);
-       assert (strncmp (p, RCSEXT, extlen) == 0);
+       assert (STRNEQ (p, RCSEXT, extlen));
        *p = '\0';
     }
 
@@ -6565,10 +6566,10 @@
     if (rcs->flags & PARTIAL)
        RCS_reparsercsfile (rcs, NULL, NULL);
 
-    if (rcs->access == NULL)
+    if (!rcs->access)
        return;
 
-    if (user == NULL)
+    if (!user)
     {
         free (rcs->access);
         rcs->access = NULL;
@@ -6577,16 +6578,16 @@
 
     p = rcs->access;
     ulen = strlen (user);
-    while (p != NULL)
+    while (p)
     {
-       if (strncmp (p, user, ulen) == 0 && (p[ulen] == '\0' || p[ulen] == ' '))
+       if (STRNEQ (p, user, ulen) && (p[ulen] == '\0' || p[ulen] == ' '))
            break;
        p = strchr (p, ' ');
-       if (p != NULL)
+       if (p)
            ++p;
     }
 
-    if (p == NULL)
+    if (!p)
        return;
 
     s = p + ulen;
@@ -6626,11 +6627,11 @@
 static int
 findmagictag (Node *node, void *arg)
 {
-    char *rev = (char *)arg;
+    char *rev = arg;
     size_t len = strlen (rev);
 
-    if (strncmp (node->data, rev, len) == 0 &&
-       strncmp ((char *)node->data + len, ".0.", 3) == 0)
+    if (STRNEQ (node->data, rev, len)
+       && STRNEQ (node->data + len, ".0.", 3))
        return 1;
     else
        return 0;
@@ -7964,8 +7965,8 @@
                for (p = vers->branches->list->next;
                     p != vers->branches->list;
                     p = p->next)
-                   if (strncmp (p->key, branchversion,
-                                cpversion - branchversion) == 0)
+                   if (STRNEQ (p->key, branchversion,
+                               cpversion - branchversion))
                        break;
                if (p == vers->branches->list)
                    error (1, 0, "missing expected branch in %s",
@@ -8123,7 +8124,7 @@
     /* Note that when comparing with RCSDATE, we are not massaging
        VALUE from the string found in the RCS file.  This is OK since
        we know exactly what to expect.  */
-    if (*cp != '\0' || strncmp (RCSDATE, value, (sizeof RCSDATE) - 1) != 0)
+    if (*cp || !STRNEQ (RCSDATE, value, sizeof RCSDATE - 1))
     {
        *keyp = key;
        *valp = value;
@@ -8261,7 +8262,7 @@
        /* Note that when comparing with RCSDATE, we are not massaging
           VALUE from the string found in the RCS file.  This is OK
           since we know exactly what to expect.  */
-       if (*cp == '\0' && strncmp (RCSDATE, value, strlen (RCSDATE)) == 0)
+       if (!*cp && STRNEQ (RCSDATE, value, strlen (RCSDATE)))
            break;
 
        /* At this point, key and value represent a user-defined field
@@ -8811,7 +8812,7 @@
     if (buflen > 0)
     {
        if (bufrest[0] != '\n'
-           || strncmp (bufrest, "\n\n\n", buflen < 3 ? buflen : 3) != 0)
+           || !STRNEQ (bufrest, "\n\n\n", buflen < 3 ? buflen : 3))
        {
            nls = 0;
        }
@@ -8840,7 +8841,7 @@
        if (nls > 0
            && got >= nls
            && buf[0] == '\n'
-           && strncmp (buf, "\n\n\n", nls) == 0)
+           && STRNEQ (buf, "\n\n\n", nls))
        {
            fwrite (buf + 1, 1, got - 1, fout);
        }
@@ -9377,7 +9378,7 @@
        *pathstore = xstrdup(CVSname);
        if ((c = strrchr(*pathstore, '/')) != NULL) {
            if (c - *pathstore >= alen) {
-               if (!strncmp(c - alen, ATTIC, alen)) {
+               if (STRNEQ(c - alen, ATTIC, alen)) {
                    while (*c != '\0') {
                        *(c - alen) = *c;
                        c++;
@@ -9388,11 +9389,11 @@
        }
 
        rootlen = strlen(current_parsed_root->directory);
-       if (!strncmp(*pathstore, current_parsed_root->directory, rootlen) &&
-           (*pathstore)[rootlen] == '/')
-           CVSname = (*pathstore + rootlen + 1);
+       if (STRNEQ (*pathstore, current_parsed_root->directory, rootlen)
+           && (*pathstore)[rootlen] == '/')
+           CVSname = *pathstore + rootlen + 1;
        else
-           CVSname = (*pathstore);
+           CVSname = *pathstore;
     }
     return CVSname;
 }
@@ -9545,7 +9546,7 @@
         */
        char *ver_str = p->data;
        if ((ver_str[pinfo->target_rev_len] == '.')
-           && (!strncmp (pinfo->target_rev, p->data, pinfo->target_rev_len)))
+           && (STRNEQ (pinfo->target_rev, p->data, pinfo->target_rev_len)))
        {
            char *plast_dot = NULL;
            char *psecond_to_last_dot = NULL;

Index: repos.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/repos.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- repos.c     27 Aug 2007 02:11:06 -0000      1.43
+++ repos.c     12 Sep 2007 18:27:08 -0000      1.44
@@ -153,8 +153,8 @@
 
     /* If repository matches CVSroot at the beginning, strip off CVSroot */
     /* And skip leading '/' in rep, in case CVSroot ended with '/'. */
-    if (strncmp (original_parsed_root->directory, repository,
-                strlen (original_parsed_root->directory)) == 0)
+    if (STRNEQ (original_parsed_root->directory, repository,
+               strlen (original_parsed_root->directory)))
     {
        const char *rep = repository + strlen (original_parsed_root->directory);
        return (*rep == '/') ? rep+1 : rep;

Index: root.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/root.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -b -r1.129 -r1.130
--- root.c      12 Sep 2007 17:27:24 -0000      1.129
+++ root.c      12 Sep 2007 18:27:08 -0000      1.130
@@ -211,7 +211,7 @@
     if (!config) return root_in;
 
     if (config->PrimaryServer
-        && !strncmp (root_in, config->PrimaryServer->directory,
+        && STRNEQ (root_in, config->PrimaryServer->directory,
                     strlen (config->PrimaryServer->directory))
         && (ISSLASH (root_in[strlen (config->PrimaryServer->directory)])
             || root_in[strlen (config->PrimaryServer->directory)] == '\0')
@@ -257,7 +257,7 @@
     if (!config) return root_in;
 
     if (config->PrimaryServer
-        && !strncmp (root_in, current_parsed_root->directory,
+        && STRNEQ (root_in, current_parsed_root->directory,
                     strlen (current_parsed_root->directory))
         && (ISSLASH (root_in[strlen (current_parsed_root->directory)])
             || root_in[strlen (current_parsed_root->directory)] == '\0')

Index: server.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/server.c,v
retrieving revision 1.480
retrieving revision 1.481
diff -u -b -r1.480 -r1.481
--- server.c    12 Sep 2007 17:27:24 -0000      1.480
+++ server.c    12 Sep 2007 18:27:08 -0000      1.481
@@ -1109,7 +1109,7 @@
     }
 
     if (repos_len < root_len
-       || strncmp (current_parsed_root->directory, repos, root_len) != 0)
+       || !STRNEQ (current_parsed_root->directory, repos, root_len))
     {
     not_within:
        push_pending_error (0,
@@ -1728,9 +1728,9 @@
     {
        name = p->entry + 1;
        cp = strchr (name, '/');
-       if (cp != NULL
+       if (cp
            && strlen (arg) == cp - name
-           && strncmp (arg, name, cp - name) == 0)
+           && STRNEQ (arg, name, cp - name))
        {
            if (!(timefield = strchr (cp + 1, '/')) || *++timefield == '\0')
            {
@@ -2133,9 +2133,9 @@
     {
        name = p->entry + 1;
        cp = strchr (name, '/');
-       if (cp != NULL
+       if (cp
            && strlen (arg) == cp - name
-           && strncmp (arg, name, cp - name) == 0)
+           && STRNEQ (arg, name, cp - name))
        {
            if (!(timefield = strchr (cp + 1, '/')) || *++timefield == '\0')
            {
@@ -6536,7 +6536,7 @@
 
        orig_cmd = cmd;
        for (rq = requests; rq->name != NULL; ++rq)
-           if (strncmp (cmd, rq->name, strlen (rq->name)) == 0)
+           if (STRNEQ (cmd, rq->name, strlen (rq->name)))
            {
                int len = strlen (rq->name);
                if (cmd[len] == '\0')
@@ -6843,8 +6843,7 @@
     namelen = strlen (username);
     while (getline (&linebuf, &linebuf_len, fp) >= 0)
     {
-       if ((strncmp (linebuf, username, namelen) == 0)
-           && (linebuf[namelen] == ':'))
+       if (STRNEQ (linebuf, username, namelen) && linebuf[namelen] == ':')
        {
            found_it = 1;
            break;
@@ -6892,15 +6891,15 @@
        /* Okay, after this conditional chain, found_password and
           host_user_tmp will have useful values: */
 
-       if ((non_cvsuser_portion == NULL)
-           || (strlen (non_cvsuser_portion) == 0)
-           || ((strspn (non_cvsuser_portion, " \t"))
-               == strlen (non_cvsuser_portion)))
+       if (!non_cvsuser_portion
+           || !*non_cvsuser_portion
+           || strspn (non_cvsuser_portion, " \t")
+              == strlen (non_cvsuser_portion))
        {
            found_password = NULL;
            host_user_tmp = NULL;
        }
-       else if (strncmp (non_cvsuser_portion, ":", 1) == 0)
+       else if (STRNEQ (non_cvsuser_portion, ":", 1))
        {
            found_password = NULL;
            host_user_tmp = non_cvsuser_portion + 1;

Index: subr.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/subr.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -b -r1.161 -r1.162
--- subr.c      12 Sep 2007 17:27:24 -0000      1.161
+++ subr.c      12 Sep 2007 18:27:08 -0000      1.162
@@ -612,9 +612,9 @@
        error (1, errno, "cannot open %s", finfo->fullname);
     while (getline (&line, &line_allocated, fp) > 0)
     {
-       if (strncmp (line, RCS_MERGE_PAT_1, sizeof RCS_MERGE_PAT_1 - 1) == 0 ||
-           strncmp (line, RCS_MERGE_PAT_2, sizeof RCS_MERGE_PAT_2 - 1) == 0 ||
-           strncmp (line, RCS_MERGE_PAT_3, sizeof RCS_MERGE_PAT_3 - 1) == 0)
+       if (STRNEQ (line, RCS_MERGE_PAT_1, sizeof RCS_MERGE_PAT_1 - 1)
+           || STRNEQ (line, RCS_MERGE_PAT_2, sizeof RCS_MERGE_PAT_2 - 1)
+           || STRNEQ (line, RCS_MERGE_PAT_3, sizeof RCS_MERGE_PAT_3 - 1))
        {
            result = 1;
            goto out;
@@ -2114,7 +2114,7 @@
     bool isparent;
 
     if (strlen (maybe_parent) <= strlen (maybe_child)
-       && !strncmp (maybe_parent, maybe_child, strlen (maybe_parent))
+       && STRNEQ (maybe_parent, maybe_child, strlen (maybe_parent))
        && (maybe_child[strlen (maybe_parent)] == '\0'
            || ISSLASH (maybe_child[strlen (maybe_parent)])))
        return true;
@@ -2129,7 +2129,7 @@
     p1 = xcanonicalize_file_name (maybe_parent);
     p2 = xcanonicalize_file_name (maybe_child);
     if (strlen (p1) <= strlen (p2)
-       && !strncmp (p1, p2, strlen (p1))
+       && STRNEQ (p1, p2, strlen (p1))
        && (p2[strlen (p1)] == '\0' || ISSLASH (p2[strlen (p1)])))
        isparent = true;
     else

Index: subr.h
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/subr.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- subr.h      12 Sep 2007 17:27:24 -0000      1.15
+++ subr.h      12 Sep 2007 18:27:08 -0000      1.16
@@ -1,8 +1,12 @@
 /*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
- * Copyright (c) 2004, Derek R. Price and Ximbiot <http://ximbiot.com>
- * Copyright (c) 1989-2004 The Free Software Foundation <http://gnu.org>
+ * Copyright (C) 1986-2007 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2007 Derek Price,
+ *                                  Ximbiot LLC <http://ximbiot.com>,
+ *                                  and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions Copyright (C) 1989-1992, Brian Berliner
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,6 +22,10 @@
 #ifndef SUBR_H
 # define SUBR_H
 
+/* ANSI C */
+#include <string.h>
+
+/* CVS */
 /* FIXME - This shouldn't be needed here.  Any routine that needs to understand
  * the underlying structure of an RCSNode should be in rcs*.c.
  */
@@ -148,9 +156,16 @@
 {
     return *a == *b && strcmp (a, b) == 0;
 }
+static inline bool
+strneq (const char *a, const char *b, size_t n)
+{
+    return !n || *a == *b && strncmp (a, b, n) == 0;
+}
 # define STREQ(a, b) streq ((a), (b))
+# define STRNEQ(a, b, n) strneq ((a), (b), (n))
 #else /* !HAVE_INLINE */
 # define STREQ(a, b) (strcmp ((a), (b)) == 0)
+# define STRNEQ(a, b, n) (strncmp ((a), (b), (n)) == 0)
 #endif /* HAVE_INLINE */
 
 #endif /* !SUBR_H */

Index: update.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/update.c,v
retrieving revision 1.275
retrieving revision 1.276
diff -u -b -r1.275 -r1.276
--- update.c    12 Sep 2007 17:27:24 -0000      1.275
+++ update.c    12 Sep 2007 18:27:08 -0000      1.276
@@ -1360,7 +1360,7 @@
            set_time =
                (!noexec
                 && (!vers_ts->vn_user ||
-                    !strncmp (vers_ts->ts_rcs, "Initial", 7))
+                    STRNEQ (vers_ts->ts_rcs, "Initial", 7))
                 && !file_is_dead);
 
            wrap_fromcvs_process_file (finfo->file);

Index: watch.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/watch.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- watch.c     12 Sep 2007 17:27:24 -0000      1.49
+++ watch.c     12 Sep 2007 18:27:08 -0000      1.50
@@ -93,8 +93,7 @@
     {
        p = curattr;
        while (1) {
-           if (strncmp (who, p, who_len) == 0
-               && p[who_len] == '>')
+           if (STRNEQ (who, p, who_len) && p[who_len] == '>')
            {
                /* Found this user.  */
                mycurattr = p + who_len + 1;
@@ -147,37 +146,37 @@
            nextp = pend + 1;
 
        /* Process this item.  */
-       if (pend - p == 4 && strncmp ("edit", p, 4) == 0)
+       if (pend - p == 4 && STRNEQ ("edit", p, 4))
        {
            if (!remove_edit_pending)
                strcat (mynewattr, "+edit");
            add_edit_pending = 0;
        }
-       else if (pend - p == 6 && strncmp ("unedit", p, 6) == 0)
+       else if (pend - p == 6 && STRNEQ ("unedit", p, 6))
        {
            if (!remove_unedit_pending)
                strcat (mynewattr, "+unedit");
            add_unedit_pending = 0;
        }
-       else if (pend - p == 6 && strncmp ("commit", p, 6) == 0)
+       else if (pend - p == 6 && STRNEQ ("commit", p, 6))
        {
            if (!remove_commit_pending)
                strcat (mynewattr, "+commit");
            add_commit_pending = 0;
        }
-       else if (pend - p == 5 && strncmp ("tedit", p, 5) == 0)
+       else if (pend - p == 5 && STRNEQ ("tedit", p, 5))
        {
            if (!what->remove_temp)
                strcat (mynewattr, "+tedit");
            add_tedit_pending = 0;
        }
-       else if (pend - p == 7 && strncmp ("tunedit", p, 7) == 0)
+       else if (pend - p == 7 && STRNEQ ("tunedit", p, 7))
        {
            if (!what->remove_temp)
                strcat (mynewattr, "+tunedit");
            add_tunedit_pending = 0;
        }
-       else if (pend - p == 7 && strncmp ("tcommit", p, 7) == 0)
+       else if (pend - p == 7 && STRNEQ ("tcommit", p, 7))
        {
            if (!what->remove_temp)
                strcat (mynewattr, "+tcommit");
@@ -266,7 +265,8 @@
        if ( the_args.local )
            set_default = STREQ (update_dir, the_args.dirs[dir_check]);
        else 
-           set_default = strncmp( update_dir, the_args.dirs[ dir_check ], 
strlen( the_args.dirs[ dir_check ] ) ) == 0;
+           set_default = STRNEQ (update_dir, the_args.dirs[dir_check],
+                                 strlen (the_args.dirs[dir_check]));
        dir_check++;
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]