mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Daniel Cegiełka" <daniel.cegielka@gmail.com>
To: musl@lists.openwall.com
Subject: Re: REG_STARTEND (regex)
Date: Tue, 15 Jan 2013 16:16:29 +0100	[thread overview]
Message-ID: <CAPLrYER-QsrVgYvgwf97e8XzoR9s3ifvyhYj-3tWOqk0JO_avA@mail.gmail.com> (raw)
In-Reply-To: <20130115134244.GW20323@brightrain.aerifal.cx>

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


  reply	other threads:[~2013-01-15 15:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 10:34 Daniel Cegiełka
2013-01-15 13:42 ` Rich Felker
2013-01-15 15:16   ` Daniel Cegiełka [this message]
2013-01-15 15:37     ` John Spencer
2013-01-15 15:50       ` Daniel Cegiełka
2013-01-15 16:13         ` Rob Landley
2013-01-15 18:38         ` John Spencer
2013-01-16 15:41           ` Rob Landley
2013-01-15 16:11     ` Rob Landley
2013-01-15 18:45     ` Rich Felker
2013-01-15 18:55       ` Daniel Cegiełka
2013-01-16 15:42       ` Rob Landley
2013-01-16 16:57         ` Rich Felker
2014-06-11 14:24     ` Justin Cormack
2014-06-12  1:00       ` bfdamkoehler
2014-06-12  1:40         ` Rich Felker
2014-06-13  1:15           ` bfdamkoehler
2014-06-13  3:00             ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPLrYER-QsrVgYvgwf97e8XzoR9s3ifvyhYj-3tWOqk0JO_avA@mail.gmail.com \
    --to=daniel.cegielka@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).