From: Richard W.M. Jones Date: Sun, 12 Jan 2020 20:56:59 +0000 (+0000) Subject: stdlib: Protect some functions using "--". X-Git-Tag: v'0.2'~20 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=be61a8a416b1bef88a416579cc663f1849ccf1cf;p=goals.git stdlib: Protect some functions using "--". If a parameter begins with a "-" character then it can be misinterpreted as a shell command parameter. Protect against this using "--" in various places. --- diff --git a/stdlib/prelude.gl b/stdlib/prelude.gl index 7dc3b73..e8a96e8 100644 --- a/stdlib/prelude.gl +++ b/stdlib/prelude.gl @@ -98,12 +98,12 @@ pure function tail (xs) returning strings = @{ # Base name. pure function basename (name) returning string = @{ - basename %name + basename -- %name } # Directory name. pure function dirname (name) returning string = @{ - dirname %name + dirname -- %name } # File extension. @@ -114,12 +114,12 @@ pure function extension (name) returning string = @{ # Read a file. function read (filename) returning string = @{ - cat %filename + cat -- %filename } # Read a file as a list of lines. function readlines (filename) returning strings = @{ - cat %filename + cat -- %filename } # Real path.