From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Sebastian Schuberth <sschuberth@gmail.com>
Cc: "SZEDER Gábor" <szeder@ira.uka.de>,
"David Aguilar" <davvid@gmail.com>,
"Phil Susi" <phillsusi@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>,
"Philip Oakley" <philipoakley@iee.org>,
"Johannes Schindelin" <johannes.schindelin@gmx.de>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: [PATCH v2] mergetools: add winmerge as a builtin tool
Date: Thu, 14 May 2015 23:48:30 +0200 [thread overview]
Message-ID: <1431640110-8484-1-git-send-email-szeder@ira.uka.de> (raw)
In-Reply-To: <5553B61D.7050204@gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1129 bytes --]
> for directory in "$(env | grep -E '^PROGRAM(FILES(\(X86\))?|W6432)=' | cut -d '=' -f 2 | sort -u)"
> do
> test -n "$directory" &&
> test -x "$directory/$winmerge_exe" &&
> echo "$directory/$winmerge_exe" &&
> break
> done
This ain't gonna work, because the output of the pipe won't be split
because of the quotes around the command substitution, so $directory will
hold everything. Simply loosing those quotes is not good either, because
the output will be split on the spaces as well, leading to 'C:\Program',
'Files' and '(x86)', unless the space is already removed from IFS. IIRC
Windows doesn't allow newlines in pathnames, so IFS=$'\n' and removing the
quotes around the command substitution should do the trick.
Pathnames can contain '=' characters, so, while I think it's outrageous,
the paths in those variables can also contain an '=' or two. Well,
theoretically, at least, and in that case the 'cut -d= -f2' will cut off
the end of the pathname. I don't know whether this is something to be
worth worrying about, but in that case it should be 'cut -d= -f2-'.
Gábor
next prev parent reply other threads:[~2015-05-14 21:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 2:00 [PATCH v2] mergetools: add winmerge as a builtin tool David Aguilar
2015-05-13 8:10 ` Johannes Schindelin
2015-05-13 13:19 ` Sebastian Schuberth
2015-05-13 15:22 ` Johannes Schindelin
2015-05-13 15:33 ` Sebastian Schuberth
2015-05-13 20:00 ` Sebastian Schuberth
2015-05-13 20:36 ` Sebastian Schuberth
2015-05-13 20:37 ` Sebastian Schuberth
2015-05-14 21:48 ` SZEDER Gábor [this message]
2015-05-15 5:46 ` Sebastian Schuberth
2015-05-15 9:01 ` SZEDER Gábor
2015-05-14 21:24 ` SZEDER Gábor
2015-05-15 5:40 ` Sebastian Schuberth
2015-05-20 4:10 ` David Aguilar
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=1431640110-8484-1-git-send-email-szeder@ira.uka.de \
--to=szeder@ira.uka.de \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
--cc=philipoakley@iee.org \
--cc=phillsusi@gmail.com \
--cc=sschuberth@gmail.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 NNTP newsgroup(s).