From: Eli Zaretskii <eliz@gnu.org>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: c-api.test fails on MS-Windows due to non-portable quoting
Date: Sun, 24 Jul 2016 17:30:51 +0300 [thread overview]
Message-ID: <83r3ajt8f8.fsf@gnu.org> (raw)
In-Reply-To: <874m7grrf7.fsf@pobox.com> (message from Andy Wingo on Sat, 23 Jul 2016 23:11:08 +0200)
> From: Andy Wingo <wingo@pobox.com>
> Cc: guile-devel@gnu.org
> Date: Sat, 23 Jul 2016 23:11:08 +0200
>
> > It fails like this:
> >
> > Running c-api.test
> > 'CUR' is not recognized as an internal or external command,
> > operable program or batch file.
> > egrep: Unmatched ( or \('CUR' is not recognized as an internal or
> > external command, operable program or batch file.
> >
> > This is because it quotes shell commands /bin/sh '..' style:
>
> Of course, because that's how `system' is specified.
On Posix hosts, yes. But the ANSI C standard only says that the
argument will be passed to the host environment's command processor.
> > --- test-suite/tests/c-api.test~0 2016-01-02 13:32:40.000000000 +0200
> > +++ test-suite/tests/c-api.test 2016-07-23 14:12:57.257375000 +0300
> > @@ -22,7 +22,7 @@
> > (define srcdir (cdr (assq 'srcdir %guile-build-info)))
> >
> > (define (egrep string filename)
> > - (zero? (system (string-append "egrep '" string "' " filename
> > + (zero? (system (string-append "egrep \"" string "\" " filename
> > " >" %null-device))))
> >
> > (define (seek-offset-test dirname)
> >
> > OK to push such a change?
>
> I think instead to get this to work on MinGW we should switch to use
> system* instead of praying that we get quoting right ;) Something like:
>
> (zero? (system* "egrep" "-q" string filename))
For this to work, the Windows implementation of system* will need to
be augmented to quote characters special for the shell, because
(unlike execvp on Posix hosts) the arguments of spawnvp are eventually
concatenated into a single string that gets passed to the system API
which invokes programs. If this is the way you are willing to solve
this, I will submit a patch to that effect.
next prev parent reply other threads:[~2016-07-24 14:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-23 11:18 c-api.test fails on MS-Windows due to non-portable quoting Eli Zaretskii
2016-07-23 21:11 ` Andy Wingo
2016-07-24 14:30 ` Eli Zaretskii [this message]
2016-08-10 6:24 ` Mark H Weaver
2016-08-10 14:26 ` Eli Zaretskii
2016-08-10 14:51 ` Eli Zaretskii
2016-08-10 17:03 ` Mark H Weaver
2016-08-13 9:11 ` Eli Zaretskii
2016-08-13 11:55 ` Eli Zaretskii
2016-08-27 8:23 ` Eli Zaretskii
2016-08-31 8:52 ` Andy Wingo
2016-08-31 19:05 ` Eli Zaretskii
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83r3ajt8f8.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=guile-devel@gnu.org \
--cc=wingo@pobox.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).