RFR (S) 8049300: jjs scripting: need way to quote $EXEC command arguments to protect spaces
Michael Haupt
michael.haupt at oracle.com
Fri May 15 14:27:07 UTC 2015
Hi,
thanks for your reviews, Sundar and Hannes, and Attila for additional remarks. All done. An updated webrev is at http://cr.openjdk.java.net/~mhaupt/8049300/webrev.01; it also turns toAppend into a StringBuilder.
Best,
Michael
> Am 15.05.2015 um 16:24 schrieb Hannes Wallnoefer <hannes.wallnoefer at oracle.com>:
>
> If the command ends with '\' the last token will be lost, you need to check toAppend after the loop.
>
> Looks good apart from that.
>
> Hannes
>
> Am 2015-05-15 um 15:42 schrieb Michael Haupt:
>> Dear all,
>>
>> please review and sponsor this change.
>> Webrev: http://cr.openjdk.java.net/~mhaupt/8049300/webrev.00
>> RFE: https://bugs.openjdk.java.net/browse/JDK-8049300
>>
>> There are several ways in which paths can contain spaces (quoting with "" or '', or escaping). The implementation of the $EXEC command would tokenise using a plain StringTokenizer, which splits a string at space characters regardless of quoting. The new implementation employs a StreamTokenizer and some extra logic to handle escaped spaces.
>>
>> Thanks,
>>
>> Michael
>>
>
--
<http://www.oracle.com/>
Dr. Michael Haupt | Principal Member of Technical Staff
Phone: +49 331 200 7277 | Fax: +49 331 200 7561
Oracle Java Platform Group | HotSpot Compiler Team
Oracle Deutschland B.V. & Co. KG, Schiffbauergasse 14 | 14467 Potsdam, Germany
<http://www.oracle.com/commitment> Oracle is committed to developing practices and products that help protect the environment
More information about the nashorn-dev
mailing list