On Tue, May 20, 2008 at 11:56 PM, James Youngman <[EMAIL PROTECTED]> wrote:
> On Fri, May 16, 2008 at 11:36 PM, James Youngman <[EMAIL PROTECTED]> wrote:
>> 2008-05-16 James Youngman <[EMAIL PROTECTED]>
>>
>> Fix Savannah bug #22662 (nanoseconds appended after "PM" for
>> find -printf %AX in locale en_US.UTF-8).
>> * find/pred.c (format_date): Use helper function do_time_format
>> which can insert the nanoseconds field into the appropriate place
>> within the formatted time. This fixes Savannah bug #22662.
>> (do_time_format): New function. Formats the date, inserting the
>> nanoseconds field after the seconds field, if there is a seconds
>> field.
>> (scan_for_digit_differences): New function. Locates the seconds
>> field.
>>
>> Signed-off-by: James Youngman <[EMAIL PROTECTED]>
>
> Applied to 4.5.x CVS code. I also intend to apply to 4.4.x (for
> release in 4.4.1) but have not yet done so.
I released 4.5.0 with this change but unfortunately there was a bug
which needs the attached fix. It'll be included in 4.5.1.
James.
Index: ChangeLog
===================================================================
RCS file: /sources/findutils/findutils/ChangeLog,v
retrieving revision 1.327
diff -u -p -r1.327 ChangeLog
--- ChangeLog 18 May 2008 22:52:24 -0000 1.327
+++ ChangeLog 28 May 2008 09:09:00 -0000
@@ -1,3 +1,14 @@
+2008-05-28 James Youngman <[EMAIL PROTECTED]>
+
+ Bugfix to the code that was previously supposed to fix bug #22662
+ in 4.5.0.
+ * find/pred.c (scan_for_digit_differences): Remember that wesaw
+ 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-05-18 James Youngman <[EMAIL PROTECTED]>
Update gnulib.
Index: NEWS
===================================================================
RCS file: /sources/findutils/findutils/NEWS,v
retrieving revision 1.245
diff -u -p -r1.245 NEWS
--- NEWS 20 May 2008 23:37:15 -0000 1.245
+++ NEWS 28 May 2008 09:09:02 -0000
@@ -1,5 +1,12 @@
GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
+* Major changes in release 4.5.1, YYYY-MM-DD
+
+** Bug Fixes
+
+#22662: find -printf %AX appends nanoseconds in the right place now.
+
+
* Major changes in release 4.5.0, 2008-05-21
** Functional Enhancements to find
Index: find/pred.c
===================================================================
RCS file: /sources/findutils/findutils/find/pred.c,v
retrieving revision 1.114
diff -u -p -r1.114 pred.c
--- find/pred.c 20 May 2008 22:53:36 -0000 1.114
+++ find/pred.c 28 May 2008 09:09:04 -0000
@@ -2038,10 +2038,11 @@ scan_for_digit_differences(const char *p
{
*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 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;