git: sdiff: fix wcwidth recursion

John Marino marino at
Wed Oct 12 17:07:41 PDT 2011

commit d76863bd1dbf9c1e4c04a977e3a7271a23cdb718
Author: John Marino <draco at>
Date:   Thu Oct 13 00:39:51 2011 +0200

    sdiff: fix wcwidth recursion
    Apparently trying to diff non-UTF8 documents caused a stack overflow.
    The culprit was correctly identified by Yonetani as the redefinition
    of wcwidth in the wcwidth.c file.  Within that function, it calls itself
    recursively forever.  I'm not sure how this would work differently
    (macro or not) on another system.
    My solution was to stop redefining wcwidth and just create a separate
    function, one that will call the system wcwidth function as needed.
    reported by: Peter Avalos

Summary of changes:
 contrib/diffutils/README.DRAGONFLY          |    9 +++++----
 contrib/diffutils/lib/wcwidth.c             |    4 ++--
 contrib/diffutils/src/side.c                |    3 ++-
 gnu/usr.bin/diff/libdiffutils/gnuwidechar.h |   11 +++++++++++
 4 files changed, 20 insertions(+), 7 deletions(-)
 create mode 100644 gnu/usr.bin/diff/libdiffutils/gnuwidechar.h

DragonFly BSD source repository

More information about the Commits mailing list