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 subr.c subr.h


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/src ChangeLog add.c subr.c subr.h
Date: Fri, 15 Aug 2008 16:23:12 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     08/08/15 16:23:12

Modified files:
        src            : ChangeLog add.c subr.c subr.h 

Log message:
        * subr.c (has_slash): New convenience function and...
        * subr.h (has_slash): ...its prototype.
        * add.c (add): Use new convenience function.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3562&r2=1.3563
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/add.c?cvsroot=cvs&r1=1.134&r2=1.135
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/subr.c?cvsroot=cvs&r1=1.165&r2=1.166
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/subr.h?cvsroot=cvs&r1=1.17&r2=1.18

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3562
retrieving revision 1.3563
diff -u -b -r1.3562 -r1.3563
--- ChangeLog   7 May 2008 16:04:36 -0000       1.3562
+++ ChangeLog   15 Aug 2008 16:23:10 -0000      1.3563
@@ -1,3 +1,9 @@
+2008-08-15  Derek R. Price  <address@hidden>
+
+       * subr.c (has_slash): New convenience function and...
+       * subr.h (has_slash): ...its prototype.
+       * add.c (add): Use new convenience function.
+
 2008-03-23  Mark D. Baushke  <address@hidden>
 
        [bug #22710]

Index: add.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/add.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -b -r1.134 -r1.135
--- add.c       12 Sep 2007 18:27:06 -0000      1.134
+++ add.c       15 Aug 2008 16:23:11 -0000      1.135
@@ -82,7 +82,7 @@
     struct saved_cwd cwd;
     /* Nonzero if we found a slash, and are thus adding files in a
        subdirectory.  */
-    int found_slash = 0;
+    bool found_slash = false;
     size_t cvsroot_len;
 
     if (argc == 1 || argc == -1)
@@ -140,19 +140,7 @@
            skip_file = 1;
        }
        else
-       {
-           char *p;
-           p = argv[i];
-           while (*p != '\0')
-           {
-               if (ISSLASH (*p))
-               {
-                   found_slash = 1;
-                   break;
-               }
-               ++p;
-           }
-       }
+           found_slash = found_slash || has_slash (argv[i]);
 
        if (skip_file)
        {

Index: subr.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/subr.c,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -b -r1.165 -r1.166
--- subr.c      23 Jan 2008 07:09:30 -0000      1.165
+++ subr.c      15 Aug 2008 16:23:11 -0000      1.166
@@ -2457,3 +2457,16 @@
 {
     return dir_append_dirs (dir, base, NULL);
 }
+
+
+
+/* Return TRUE if PATH contains a slash as determined by ISSLASH().
+ */
+bool
+has_slash (const char *path)
+{
+    while (*path)
+       if (ISSLASH (*(path++)))
+           return true;
+    return false;
+}

Index: subr.h
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/subr.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- subr.h      20 Dec 2007 16:09:26 -0000      1.17
+++ subr.h      15 Aug 2008 16:23:11 -0000      1.18
@@ -141,6 +141,7 @@
 
 char *dir_append (const char *dir, const char *append);
 char *dir_append_dirs (const char *dir, ...);
+bool has_slash (const char *path);
 
 
 




reply via email to

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