From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Eric Wong <normalperson@yhbt.net>,
Andrej Manduch <amanduch@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH v2] git svn: info: correctly handle absolute path args
Date: Mon, 8 Sep 2014 00:22:56 +0000 [thread overview]
Message-ID: <20140908002256.GB43902@vauxhall.crustytoothpaste.net> (raw)
In-Reply-To: <540C1E07.7030105@kdbg.org>
[-- Attachment #1: Type: text/plain, Size: 893 bytes --]
On Sun, Sep 07, 2014 at 10:57:43AM +0200, Johannes Sixt wrote:
> Am 07.09.2014 10:06, schrieb Eric Wong:
> > sub cmd_info {
> > - my $path = canonicalize_path(defined($_[0]) ? $_[0] : ".");
> > - my $fullpath = canonicalize_path($cmd_dir_prefix . $path);
> > + my $path_arg = defined($_[0]) ? $_[0] : '.';
> > + my $path = $path_arg;
> > + if ($path =~ m!\A/!) {
>
> There must be a more portable way to check for an absolute path. Think
> of DOS-style paths...
You probably want File::Spec->file_name_is_absolute($path). Either that
or always turn the path into absolute or relative form with
File::Spec->abs2rel or File::Spec->rel2abs, and then go from there.
--
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-09-08 0:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-07 8:06 [PATCH v2] git svn: info: correctly handle absolute path args Eric Wong
2014-09-07 8:57 ` Johannes Sixt
2014-09-08 0:22 ` brian m. carlson [this message]
2014-09-09 6:38 ` [PATCH v3] " Eric Wong
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: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140908002256.GB43902@vauxhall.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=amanduch@gmail.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=normalperson@yhbt.net \
/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://80x24.org/mirrors/git.git
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).