bug-findutils
[Top][All Lists]
Advanced

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

[PATCH 03/19] Fix bugs in bugfix for #22662


From: James Youngman
Subject: [PATCH 03/19] Fix bugs in bugfix for #22662
Date: Fri, 10 Apr 2009 23:53:00 +0100

---
 ChangeLog   |   24 +++++++++++++++++-------
 NEWS        |    1 +
 find/pred.c |    5 +++--
 3 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index db80680..fb8d234 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,16 @@
        Backport a fix from 4.5.x.
        * doc/find.texi (Cleaning Up): Move the note about -depth up.
 
+2009-04-10  James Youngman  <address@hidden>
+
+       Fix bug #22662 (backport from 4.5.x)
+       * find/pred.c (scan_for_digit_differences): Remember that we saw
+       the first differing digit and also get the order of the
+       subtractionoperands right.
+       (do_time_format): Off by one error on checking for a nondigit
+       after the sequence of changed digits.
+       * NEWS: Mention this change.
+
 2008-12-23  James Youngman  <address@hidden>
 
        Fix Savannah bug #25154: Failure to compile with GCC-2.95.4
@@ -18,7 +28,7 @@
        fatal error message instead of returning false, because the error
        message that results from a return of false is "invalid argument",
        which is misleading in this case.  Similarly for a missing or an
-       empty argument.  
+       empty argument.
 
 2008-12-01  James Youngman  <address@hidden>
 
@@ -27,16 +37,16 @@
        * po/id.po: Updated Indonesian translation.
 
 2008-12-01  Geoff Gole  <address@hidden>
- 
+
        * xargs/xargs.1 (STANDARDS CONFORMANCE): Fix typo.
- 
+
 2008-08-31  James Youngman  <address@hidden>
 
        Fix Savannah bug #24169 (-neweraa without following arg coredumps).
        * find/parser.c (parse_newerXY): Issue a fatal error message if
        there is no following argument.
        * find/testsuite/find.gnu/sv-bug-24169.exp: Test case for this
-       bug.  
+       bug.
        * find/testsuite/Makefile.am (EXTRA_DIST_EXP): Also distribute
        this new test file.
        * NEWS: Mention this change.
@@ -62,7 +72,7 @@
 2008-06-19  Per Starbäck  <address@hidden> (tiny change)
 
        * doc/find.texi (Unusual characters in filenames): Directory
-       separator is the slash, not the backslash.  
+       separator is the slash, not the backslash.
 
 2008-06-19  James Youngman  <address@hidden>
 
@@ -117,11 +127,11 @@
        * NEWS: Listed changes between 4.2.33 (the previous stable
        release) and 4.4.0 (the current one).
        * README-alpha: delete, since the 4.4.x branch is not a
-       development branch.  
+       development branch.
 
 2008-03-10  Justin Pryzby  <address@hidden> (tiny change)
 
-       * doc/find.texi: Various typo corrections. 
+       * doc/find.texi: Various typo corrections.
 
 2008-03-10  Eric Blake  <address@hidden>
 
diff --git a/NEWS b/NEWS
index 0f7611c..8cc4dc4 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ unknown user or is missing.
 #25154: Allow compilation with C compilers that don't allow
 declarations to follow statements.
 
+#22662: find -printf %AX appends nanoseconds in the right place now.
 
 ** Functional Enhancements to find
 
diff --git a/find/pred.c b/find/pred.c
index 5247311..8cfaf74 100644
--- a/find/pred.c
+++ b/find/pred.c
@@ -2038,10 +2038,11 @@ scan_for_digit_differences(const char *p, const char *q,
            {
              *first = i;
              *n = 1;
+             seen = 1;
            }
          else
            {
-             if (*first - i == *n)
+             if (i-*first == *n)
                {
                  /* Still in the first sequence of differing digits. */
                  ++*n;
@@ -2113,7 +2114,7 @@ do_time_format (const char *fmt, const struct tm *p, 
const char *ns, size_t ns_s
           * When that happens, we just avoid inserting the nanoseconds field.
           */
          if (scan_for_digit_differences (buf, altbuf, &i, &n)
-             && (2==n) && buf[i+n] && !isdigit((unsigned char)buf[i+n+1]))
+             && (2==n) && !isdigit((unsigned char)buf[i+n]))
            {
              const size_t end_of_seconds = i + n;
 
-- 
1.5.6.5





reply via email to

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