From 1e59399fd926c3db9d85576489362358cd4d401f Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 16 Oct 2016 11:34:15 +0200 Subject: [PATCH] libgnuregex: fix debug build. Add missing "printchar.c", which is only used in DEBUG mode. The function was recovered from original regex sources. Note that the gnu regexp library is deprecated, and so is its replacement, gnu rx. GNU suggests using the regex implementation from the glibc, but that one isn't as portable. Thanks to Andrew Lindesay for the investigations and initial patch! Fixes #12952. --- src/build/libgnuregex/Jamfile | 1 + src/build/libgnuregex/printchar.c | 43 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/build/libgnuregex/printchar.c diff --git a/src/build/libgnuregex/Jamfile b/src/build/libgnuregex/Jamfile index cfcc8ef53f..ac52ac84ea 100644 --- a/src/build/libgnuregex/Jamfile +++ b/src/build/libgnuregex/Jamfile @@ -2,6 +2,7 @@ SubDir HAIKU_TOP src build libgnuregex ; BuildPlatformSharedLibrary libgnuregex_build.so : regex.c + printchar.c : # no linked libraries here ; diff --git a/src/build/libgnuregex/printchar.c b/src/build/libgnuregex/printchar.c new file mode 100644 index 0000000000..2633b9b715 --- /dev/null +++ b/src/build/libgnuregex/printchar.c @@ -0,0 +1,43 @@ +/* Extended regular expression matching and search library, + version 0.12. + (Implements POSIX draft P10003.2/D11.2, except for + internationalization features.) + + Copyright (C) 1993 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* (this file was downloaded from + * https://raw.githubusercontent.com/ge-ne/bibtool/master/regex-0.12/test/printchar.c , + * where no copyright header is included). + */ +#ifdef DEBUG + +void +printchar (c) + char c; +{ + if (c < 040 || c >= 0177) + { + putchar ('\\'); + putchar (((c >> 6) & 3) + '0'); + putchar (((c >> 3) & 7) + '0'); + putchar ((c & 7) + '0'); + } + else + putchar (c); +} + +#endif