From be61a8a416b1bef88a416579cc663f1849ccf1cf Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 12 Jan 2020 20:56:59 +0000 Subject: [PATCH] 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. --- stdlib/prelude.gl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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. -- 1.8.3.1