RFR 8166051: [jline] Cannot parse .inputrc with \r

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Sep 16 20:41:47 UTC 2016


While the overall syntax of the file may be publicly defined, surely you 
are at liberty to define how you interpret the characters in the values 
found in .inputrc.  In other words, follow the standards for whitespace 
and line breaks, but if you find the character sequence THIS-IS-A-RETURN 
then you can replace it with (char)0x0d

-- Jon



On 9/16/16 12:08 PM, Robert Field wrote:
>
> On 09/16/16 11:31, Jonathan Gibbons wrote:
>> Perhaps your .inputrc reader should support an escape mechanism for 
>> handling problematic characters.
>
> .inputrc is a standard not under our control:
>
> https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File.html 
>
>
> Though!  That gives a hint on how we should handle this: figure out 
> what bash does.
>
> -Robert
>
>
>>
>> -- Jon
>>
>> On 09/16/2016 09:26 AM, Robert Field wrote:
>>> BufferedReader provides platform independent behavior.  Which is 
>>> appropriate here because configuration files get copied between 
>>> platforms with different line-end standards.
>>> The proposed replacement exchanges this for a platform dependent 
>>> strategy.
>>> While it would address this one obscure failure, my concern is that 
>>> it will create new, possibly more common, problems. specifically 
>>> where a file where \r\n is used -- injecting \r into the results.
>>> Not sure what the right choice is.
>>> A compromise might be to accept \n or \r\n on all platforms, and \r 
>>> alone only on platforms that accept that as a line end.
>>> I am concerned with forking jline, esp. if it not a clear fix.
>>> Can we address this at a higher level?  More tolerant error handling?
>>>
>>> -Robert
>>>
>>>
>>> On 09/16/16 02:23, Jan Lahoda wrote:
>>>> Please review a change to how .inputrc is read. Currently, it uses 
>>>> BufferedReader.readLine(), which interprets '\r' as a line 
>>>> separator, and so the '\r' character cannot be used in the macros. 
>>>> The proposed change is to use System.getProperty("line.separator") 
>>>> and "\n" as line separators.
>>>>
>>>> Bug:
>>>> https://bugs.openjdk.java.net/browse/JDK-8166051
>>>>
>>>> Webrev:
>>>> http://cr.openjdk.java.net/~jlahoda/8166051/webrev.00/
>>>>
>>>> Thanks!
>>>>
>>>> Jan
>>>
>>
>



More information about the kulla-dev mailing list