Author: daijy Date: Tue Aug 8 00:07:36 2017 New Revision: 1804367 URL: http://svn.apache.org/viewvc?rev=1804367&view=rev Log: PIG-5254: Hit Ctrl-D to quit grunt shell fail
Modified: pig/branches/branch-0.17/CHANGES.txt pig/branches/branch-0.17/src/org/apache/pig/tools/grunt/ConsoleReaderInputStream.java Modified: pig/branches/branch-0.17/CHANGES.txt URL: http://svn.apache.org/viewvc/pig/branches/branch-0.17/CHANGES.txt?rev=1804367&r1=1804366&r2=1804367&view=diff ============================================================================== --- pig/branches/branch-0.17/CHANGES.txt (original) +++ pig/branches/branch-0.17/CHANGES.txt Tue Aug 8 00:07:36 2017 @@ -28,6 +28,8 @@ OPTIMIZATIONS Â BUG FIXES +PIG-5254: Hit Ctrl-D to quit grunt shell fail (wjqian via daijy) + PIG-4548: Records Lost With Specific Combination of Commands and Streaming Function (knoguchi) Release 0.17.0 Modified: pig/branches/branch-0.17/src/org/apache/pig/tools/grunt/ConsoleReaderInputStream.java URL: http://svn.apache.org/viewvc/pig/branches/branch-0.17/src/org/apache/pig/tools/grunt/ConsoleReaderInputStream.java?rev=1804367&r1=1804366&r2=1804367&view=diff ============================================================================== --- pig/branches/branch-0.17/src/org/apache/pig/tools/grunt/ConsoleReaderInputStream.java (original) +++ pig/branches/branch-0.17/src/org/apache/pig/tools/grunt/ConsoleReaderInputStream.java Tue Aug 8 00:07:36 2017 @@ -21,7 +21,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.SequenceInputStream; import java.util.Enumeration; - import jline.console.ConsoleReader; import jline.console.history.FileHistory; @@ -104,7 +103,11 @@ public class ConsoleReaderInputStream ex } if (buffer == null) { - buffer = reader.readLine().getBytes(); + //buffer = reader.readLine().getBytes(); + String buff = reader.readLine(); + if (buff == null){ + buff = "quit";} + buffer = buff.getBytes(); //Write current grunt buffer to pig history file ((FileHistory)reader.getHistory()).flush();