From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: bug#30116: [PATCH] `substitute' crashes when file contains NUL characters (core-updates) Date: Sat, 20 Jan 2018 23:24:34 -0500 Message-ID: <87607vu9dp.fsf@gmail.com> References: <87r2qrc3mq.fsf@gmail.com> <87o9lu6o9m.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ed7Bp-0005On-QR for bug-guix@gnu.org; Sat, 20 Jan 2018 23:25:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ed7Bm-0006v2-Mr for bug-guix@gnu.org; Sat, 20 Jan 2018 23:25:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:56822) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ed7Bm-0006ut-J5 for bug-guix@gnu.org; Sat, 20 Jan 2018 23:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ed7Bm-0004gC-9F for bug-guix@gnu.org; Sat, 20 Jan 2018 23:25:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87o9lu6o9m.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 16 Jan 2018 12:23:17 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30116@debbugs.gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi, > > Maxim Cournoyer skribis: > >> I've encountered the following crash when trying to use substitute on a >> file which contains NUL characters: > > Yes, that=E2=80=99s because Guile=E2=80=99s =E2=80=98regexp-exec=E2=80=99= simply wraps libc=E2=80=99s =E2=80=98regexec=E2=80=99, > which does not handle NULs. > > We should consider switching to the pure-Scheme SRFI-115: > > https://srfi.schemers.org/srfi-115/srfi-115.html This looks good, and I started looking into porting `substitute' to it, but quickly noticed it doesn't seem to be implemented in Guile yet? Thanks, Maxim