Skip Menu |

This queue is for tickets about the IO-Prompter CPAN distribution.

Report information
The Basics
Id: 89199
Status: open
Priority: 0/
Queue: IO-Prompter

People
Owner: Nobody in particular
Requestors: gbjk [...] thermeon.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.004008
Fixed in: (no value)



Subject: -default not used when enter doesn't pass -must validation
Hi, I've found that if you specify a -default, and a -must value which doesn't accept a plain carriage return, then the default won't be used and the validation error will be shown. This seemed to be because _verify_input_constraints is called, and it sees that \r doesn't pass the constraint, so runs next INPUT, and goes back to user input again, having shown a $failed warning. I'm afraid I don't have a patch for this, I've just had to quickly and dirtily move validation to above prompt in our usage. Hope the report helps, anyway. Gareth
Subject: Re: [rt.cpan.org #89199] -default not used when enter doesn't pass -must validation
Date: Thu, 3 Oct 2013 07:32:36 +1000
To: bug-IO-Prompter [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Hi Gareth, You reported: Show quoted text
> I've found that if you specify a -default, and a -must value which doesn't accept a plain carriage return, then the default won't be used and the validation error will be shown.
It's a bug in handling \r vs \n (i.e. a "feature" of Windows ;-) I have what I believe is a correct patch, but can't test it myself. I've emailed you directly with the patched version. Please let me know if it resolves this issue and I'll then upload it. Thanks! Damian