From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2609 Path: news.gmane.org!not-for-mail From: =?ISO-8859-2?Q?Daniel_Cegie=B3ka?= Newsgroups: gmane.linux.lib.musl.general Subject: Re: REG_STARTEND (regex) Date: Tue, 15 Jan 2013 16:16:29 +0100 Message-ID: References: <20130115134244.GW20323@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1358263027 5595 80.91.229.3 (15 Jan 2013 15:17:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2013 15:17:07 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2610-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jan 15 16:17:24 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Tv8GM-0003sL-Ss for gllmg-musl@plane.gmane.org; Tue, 15 Jan 2013 16:17:19 +0100 Original-Received: (qmail 8007 invoked by uid 550); 15 Jan 2013 15:17:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7988 invoked from network); 15 Jan 2013 15:17:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=8zsl8lvwwJBUqKf4qBjST/IBTDEM8HwWDmMAvOHsGAw=; b=qrlHmcKQeEH93oC3Qv4HxOEe10pSnjLeQMTuwpB0GLD4/JNMw/PqJJoHf+IJuWyDYb jJ+0kjf2HTZjqksUW6S3NpkYu2kzo7jJmieYcY9a34vqycEIiW6xjZp0jLcASIP7ITZ/ 9RP+vtlCtUYpphh8kEFPhCajGjOHa4a3FkG5WCnTiCX+froFcoIoPq/Kpwa21RSBcWtD rwV6eObvu/vNXLgXPTWx52atlZnFhoMhRyYTF9H2nVmiaydbSlvCmvEptTUapBJWlWVS M8r2f35sZip+VDzkMSUmWCtPQJYkG0b8JNrjCOdVMigZCzfb9kxJLm4YOP19TMxi9VHi +CxA== In-Reply-To: <20130115134244.GW20323@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:2609 Archived-At: Thank you for your reply. It's terribly sad that there are so many problems with portability. There are a lot of high-quality tools in the *BSD, which could be used in Linux. And rather than stick to the POSIX people still create a barrier, like REG_STARTEND, 'sed -i', bison (instead POSIX yacc), perl in the Makefile(!!!) etc. 'sed -i' is used in many programs (even linux, e2fsprogs, old libcap etc.) and there is no chance to avoid it. So I'm looking for an alternative to the gnu-sed+gnulib. I found that sed from FreeBSD has support for -i and is much smaller than the gnu sed: http://svnweb.freebsd.org/base/release/9.1.0/usr.bin/sed/ ls -lh /bin/sed ./sed -rwxr-xr-x 1 root root 143K Jun 22 2012 /bin/sed -rwxr-xr-x 1 root root 35K Jan 15 14:32 ./sed (compiled on linux with glibc) Now I want to use it with musl, but sed (and grep) from FreeBSD uses REG_STARTEND and I don't really know how to solve this problem. http://svnweb.freebsd.org/base/release/9.1.0/usr.bin/sed/process.c?revision=243808&view=markup 651 /* Set anchors */ 652 match[0].rm_so = 0; 653 match[0].rm_eo = slen; 654 655 eval = regexec(defpreg, string, 656 nomatch ? 0 : maxnsub + 1, match, eflags | REG_STARTEND); Does anyone have suggestions on how this can be modified to be able to use it with musl. Daniel