DragonFly commits List (threaded) for 2011-10
git: DragonFly_RELEASE_2_12 sdiff: fix wcwidth recursion
Author: John Marino <firstname.lastname@example.org>
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