Skip Menu |

This queue is for tickets about the FindBin-libs CPAN distribution.

Report information
The Basics
Id: 35510
Status: resolved
Priority: 0/
Queue: FindBin-libs

People
Owner: LEMBARK [...] cpan.org
Requestors: BRUNORC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.37
Fixed in: (no value)



Subject: Problem returning dirnames containing spaces
When the dirname contains spaces, it is treated as two dirs because of replacing token 'list' with the raw list of found directories. I attached the quick'n'dirty patch that works for me.
Subject: spaces.patch
343c343 < use lib qw( list ) ; --- > use lib ( list ) ; 351c351 < splice @code, 7, 1, @libz; --- > splice @code, 7, 1, map("'$_'", @libz);
Sorry about the delay -- I missed the original notice. What is this a patch to? There is no variable named "code" in the module. The dirctory paths are returned as-is from the operating system (via $ File::Find::name). The only split I use is File::Spec::Functions::splitpath, which seems to handle whitespace gracefully: DB<3> x splitpath '/this/is a /test', 1 0 '' 1 '/this/is a /test' 2 '' The only case where whitespace is treated specifically is in handling directories to ignore, which are split on /\s*,\s*/, which would obviously cause problems for directory names with embedded whitespace and commas... only fix there is allowing the caller to pass in an arrayref. Q: Do you have any more specific example of where this causes a problem (e.g. a full path and what it is returned as)? thanx
Hello On Wto. 11 Sie. 2009, 11:30:00, LEMBARK wrote: Show quoted text
> Sorry about the delay -- I missed the original notice.
No problem :) Show quoted text
> What is this a patch to? There is no variable named "code" in the > module.
Not in the current version, I submitted this bug regarding the 1.37 version. BTW: in the URL there is version 1.41 (http://search.cpan.org/~lembark/FindBin-libs-1.41/lib/FindBin/libs.pm), but on the page there's "Module Version: 1.40" and the same version number is put in the code. Show quoted text
> Q: Do you have any more specific example of where this causes a problem > (e.g. a full path and what it is returned as)?
It would be rather hard, as I work in a different company now and don't remember the context of this bug, sorry.
Subject: Re: [rt.cpan.org #35510] Problem returning dirnames containing spaces
Date: Wed, 12 Aug 2009 00:11:33 +0200
To: bug-FindBin-libs [...] rt.cpan.org
From: Bruno <brunorc [...] gmail.com>
Hi 2009/8/11 Steven Lembark via RT <bug-FindBin-libs@rt.cpan.org>: Show quoted text
> Q: Do you have any more specific example of where this causes a problem > (e.g. a full path and what it is returned as)?
If I remember correctly, there was a case similar to this (using the module in the path containing spaces) but it doesn't happen anymore. As I mentioned on RT, the bug regarded the version 1.37. mcbetka:FindBin-libs-1.41 bruno$ pwd /Users/bruno/Downloads/dir with spaces/FindBin-libs-1.41 mcbetka:FindBin-libs-1.41 bruno$ make test PERL_DL_NONLAZY=1 /opt/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01.t .. ok t/02.t .. Possible attempt to separate words with commas at t/02.t line 26. t/02.t .. ok t/03.t .. Found */bin: /Users/bruno/Downloads/dir with spaces/FindBin-libs-1.41/bin /Users/bruno/bin /bin t/03.t .. ok t/04.t .. Useless use of a constant in void context at t/04.t line 15. t/04.t .. ok t/05.t .. ok t/06.t .. ok t/07.t .. ok All tests successful. Files=7, Tests=13, 0 wallclock secs ( 0.05 usr 0.03 sys + 0.28 cusr 0.09 csys = 0.45 CPU) Result: PASS Thanks for your attention! Cheers, Bruno