[perl #19153] Term::Complete (the argument of stty)
[p5sagit/p5-mst-13.2.git] / lib / Term / Complete.pm
index 308af04..4ae4541 100644 (file)
@@ -106,6 +106,7 @@ sub Complete {
            $tty_saved_state = undef;
        }
        else {
+           chomp $tty_saved_state;
            $tty_restore = qq($stty "$tty_saved_state");
        }
     }
@@ -116,7 +117,7 @@ sub Complete {
             CASE: {
                 # (TAB) attempt completion
                 $_ eq "\t" && do {
-                    @match = grep(/^$return/, @cmp_lst);
+                    @match = grep(/^\Q$return/, @cmp_lst);
                     unless ($#match < 0) {
                         $l = length($test = shift(@match));
                         foreach $cmp (@match) {
@@ -133,7 +134,7 @@ sub Complete {
 
                 # (^D) completion list
                 $_ eq $complete && do {
-                    print(join("\r\n", '', grep(/^$return/, @cmp_lst)), "\r\n");
+                    print(join("\r\n", '', grep(/^\Q$return/, @cmp_lst)), "\r\n");
                     redo LOOP;
                 };