git: diff(1): Update header time format to be compatible with GNU diff

Aaron LI aly at crater.dragonflybsd.org
Tue May 6 19:23:22 PDT 2025


commit c7db528193ad7f3435d4d8c7b0be80ccda43c1f6
Author: Aaron LI <aly at aaronly.me>
Date:   Wed May 7 10:17:07 2025 +0800

    diff(1): Update header time format to be compatible with GNU diff
    
    The old code was calling ctime() to format the time, which had a format
    like "Tue May  6 19:00:26 2025" that was different from the GNU diff.
    Fix the code to format the time in the same format as GNU diff, e.g.,
    "2025-05-06 19:00:26.113084000 +0800".
    
    FreeBSD also made such a change to its diff.  However, we don't consider
    the '-c' option here, because I checked with GNU diff and it didn't
    change the time format with the '-c' option.
    
    Referred-to: FreeBSD

Summary of changes:
 usr.bin/diff/diffreg.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c7db528193ad7f3435d4d8c7b0be80ccda43c1f6


-- 
DragonFly BSD source repository


More information about the Commits mailing list