[libio-prompter-perl] 01/01: Imported Upstream version 0.004010

Salvatore Bonaccorso carnil at debian.org
Thu Oct 3 21:19:00 UTC 2013


This is an automated email from the git hooks/post-receive script.

carnil pushed a commit to annotated tag upstream/0.004010
in repository libio-prompter-perl.

commit b397ba7390241183befeddad43cf3c78e7aaefe1
Author: Salvatore Bonaccorso <carnil at debian.org>
Date:   Thu Oct 3 23:16:29 2013 +0200

    Imported Upstream version 0.004010
---
 Changes            |   11 ++++++++++-
 META.yml           |    2 +-
 README             |    2 +-
 lib/IO/Prompter.pm |   17 ++++++++++-------
 4 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/Changes b/Changes
index 43af0ad..7a11103 100644
--- a/Changes
+++ b/Changes
@@ -134,4 +134,13 @@ Revision history for IO-Prompter
 
     * Further improvements under 5.18
       (thanks, Gareth)
-    
+
+
+
+0.004010  Thu Oct  3 18:17:48 2013
+
+    * Still further improvements under Windows
+      (thanks, Gareth)
+
+    * Fixed spurious ERASEs when deleting "past" start of input
+      (thanks, Gareth)
diff --git a/META.yml b/META.yml
index 5a7da97..55be950 100644
--- a/META.yml
+++ b/META.yml
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               IO-Prompter
-version:            0.004009
+version:            0.004010
 abstract:           Prompt for input, read it, clean it, return it.
 author:
     - Damian Conway <DCONWAY at CPAN.org>
diff --git a/README b/README
index 8d16641..15f4469 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-IO::Prompter version 0.004009
+IO::Prompter version 0.004010
 
 Prompt for, read, vet, chomp, and encapsulate input.
 Like so:
diff --git a/lib/IO/Prompter.pm b/lib/IO/Prompter.pm
index aa6ffcf..1e42e6b 100644
--- a/lib/IO/Prompter.pm
+++ b/lib/IO/Prompter.pm
@@ -9,7 +9,7 @@ use Contextual::Return;
 use Scalar::Util qw< openhandle looks_like_number >;
 use Symbol       qw< qualify_to_ref >;
 
-our $VERSION = '0.004009';
+our $VERSION = '0.004010';
 
 my $fake_input;     # Flag that we're faking input from the source
 
@@ -185,7 +185,7 @@ sub prompt {
             }
 
             # Handle defaults by selecting and ejecting...
-            if ($tag =~ /\A\n?\Z/ && exists $opt_ref->{-def}) {
+            if ($tag =~ /\A\R?\Z/ && exists $opt_ref->{-def}) {
                 $input = $tag;
                 last MENU;
             }
@@ -877,7 +877,7 @@ sub _verify_input_constraints {
 
     # Use default if appropriate (but short-circuit checks if -DEFAULT set)...
     my $input = ${$input_ref};
-    if (${$input_ref} =~ m{^$}xms && exists $opt_ref->{-def}) {
+    if (${$input_ref} =~ m{^\R?$}xms && exists $opt_ref->{-def}) {
         return 1 if $opt_ref->{-def_nocheck};
         $input = $opt_ref->{-def}
     }
@@ -1098,7 +1098,7 @@ sub _current_history_for {
     my ($prefix, $opt_ref) = @_;
 
     my $prefix_len = length($prefix);
-    return q{}, map { /\n$/ ? substr($_,0,-1) : $_ }
+    return q{}, map { /\A (.*?) \R \Z/x ? $1 : $_ }
                grep { substr($_,0,$prefix_len) eq $prefix }
                     @{ $history_cache{$opt_ref->{-history}} };
 }
@@ -1314,8 +1314,11 @@ sub _generate_unbuffered_reader_from {
                 }
 
                 # Handle erasures (including pushbacks if faking)...
-                elsif (!$prev_was_verbatim && $next eq $ctrl{ERASE} && length $input) {
-                    if ($insert_offset) {
+                elsif (!$prev_was_verbatim && $next eq $ctrl{ERASE}) {
+                    if (!length $input) {
+                        # Do nothing...
+                    }
+                    elsif ($insert_offset) {
                         # Can't erase past start of input...
                         next INPUT if $insert_offset >= length($input);
 
@@ -1681,7 +1684,7 @@ IO::Prompter - Prompt for input, read it, clean it, return it.
 
 =head1 VERSION
 
-This document describes IO::Prompter version 0.004009
+This document describes IO::Prompter version 0.004010
 
 
 =head1 SYNOPSIS

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libio-prompter-perl.git



More information about the Pkg-perl-cvs-commits mailing list