Skip Menu |

This queue is for tickets about the Getopt-Euclid CPAN distribution.

Report information
The Basics
Id: 35895
Status: resolved
Priority: 0/
Queue: Getopt-Euclid

People
Owner: Nobody in particular
Requestors: alvar [...] .a-blast.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: v0.2.0
Fixed in: v0.2.2



Subject: Bug with line delimeters (tests and fix included)
Hi, Getopt::Euclid (Getopt-Euclid-v0.2.0) has a critical bug with line delimeters: When using a file with Unix line endings, no options are recognised when the script (or module) runs on Windows and vice versa. The result is, that the same files can not run on Windows AND Unix. There is no error message. All options are simply ignored. :-( Attached there is a diff with the following changes and the complete distribution with: * Tests, which show the bugs - t/line_delimeters-unix.t - t/line_delimeters-windows.t - t/line_delimeters-mac-os-classic.t * A fixed version of lib/Getopt/Euclid.pm * diff with all changes: getopt-euclid-newline-patch.diff The changes begin in line 83: # # Clean up line delimeters: # Windows : \x0D\x0A # Unix : \x0A # MacOS Classic: \x0D # # => Replace them by native line ending on this platform: \n # my $LINE_DELIMETERS = qr{ \x0D? \x0A | \x0D }xms; $source =~ s{ $LINE_DELIMETERS }{\n}gxms; map { s{ $LINE_DELIMETERS }{\n}gxms; } @std_POD; It would be good if the bug gets fixed soon in the version distributed via CPAN. BTW: There is another "bug": The documentation sais that "no bugs have been reported" -- this is not true, there are some bugs in RT ... Ciao Alvar -- ** Alvar C.H. Freude ** http://alvar.a-blast.org/ ** http://www.perl-blog.de/
Subject: getopt-euclid-newline-patch.tar.gz

Message body not shown because it is not plain text.

Hi Alvar, I ran the tests against the version of Getopt::Euclid I am getting ready to release, which hasn't had your patch applied. It passed the tests, which makes them seem dubious... Anyway, I'll release 0.2.1 without addressing this bug, but will look into the issue. -Kevin
From: bitcard_ok [...] alvar.a-blast.org
Hi, On So. 31. Mai 2009, 10:31:31, kgalinsky wrote: Show quoted text
> I ran the tests against the version of Getopt::Euclid I am getting ready > to release, which hasn't had your patch applied. It passed the tests, > which makes them seem dubious... Anyway, I'll release 0.2.1 without > addressing this bug, but will look into the issue.
hmmm; perhaps this depends on the OS you are using. It is some time ago that I build the patch ... But, nevertheless: thanks for taking the maintainership of this module and fixing bugs! Attached I send you my version of Getopt::Euclid, which has some more changes included then the patch above -- it now works with PAR and the strange message with enabled ithreads is fixed. (#35147, #37182) Ciao Alvar

Message body is not shown because it is too large.

On Mo. 01. Jun. 2009, 04:00:23, alvar-f wrote: Show quoted text
> hmmm; perhaps this depends on the OS you are using. It is some time > ago that I build the > patch ...
strange ... Now I run the tests against an unpatched version of Getopt::Euclid, and the tests pass (OS X with native Unix line endings). It seems that the tests are buggy ... But the bug is there ;) and the patch fixes it. Ciao Alvar
Including the following code snippet into Euclid 2.2 which should do the same as your code but is more readable: # Clean up line delimeters s{ [\n\r] }{\n}gx foreach ($source, @std_POD);