Skip Menu |

This queue is for tickets about the Term-ShellUI CPAN distribution.

Report information
The Basics
Id: 133560
Status: new
Priority: 0/
Queue: Term-ShellUI

People
Owner: BRONSON [...] cpan.org
Requestors: hightowe [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.92
Fixed in: (no value)



Subject: Infinite loop condition in Text/Shellwords/Cursor.pm parsel()
This perl command line demonstrates the problem: $ perl -MData::Dumper -MText::Shellwords::Cursor -e '$p=Text::Shellwords::Cursor->new(); $p->{debug}=9; @t = $p->parse_line("open c:\\u"); print Dumper(\@t); print "\n\n---\n"; @t = $p->parse_line("open foo close c:\\"); print Dumper(\@t);' | head -75 The second call to parse_line() will never return (infinite loop), without output as follows: -- top, pos=0 Found unquoted string 'open' pushing 'open' -- top, pos=4 trimmed 1 whitespace chars, Found unquoted string 'foo' pushing 'foo' -- top, pos=8 trimmed 3 whitespace chars, Found unquoted string 'close' pushing 'close' -- top, pos=16 trimmed 1 whitespace chars, Found unquoted string 'c:' pushing 'c:' -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 -- top, pos=19 ... Adding these lines of code after line 311 i Text/Shellwords/Cursor.pm will prevent the infinite loop, but likely is not the entirety of the needed fix: if(/\G\\/gco) { $pieces[$#pieces] .= '\\'; } Thanks