# HG changeset patch # User William Astle # Date 1690152149 21600 # Node ID 7627d2b3b81fea65ec342b244e0433bce2777d47 # Parent 3a173cefc814e160a4edd3d54a32699bbc1bab56 Allow using - to refer to standard input for file names While POSIX-y systems will work with something like /dev/fd/0 to open the standard input, allowing - as a placeholder for standard input is more consistent with historical precedent and should be somewhat useful. diff -r 3a173cefc814 -r 7627d2b3b81f lwasm/input.c --- a/lwasm/input.c Thu Jul 06 12:06:22 2023 -0600 +++ b/lwasm/input.c Sun Jul 23 16:42:29 2023 -0600 @@ -297,7 +297,10 @@ case input_type_file: debug_message(as, 1, "Opening (reg): %s\n", s); - IS -> data = fopen(s, "rb"); + if (s[0] == '-' && s[1] == '\0') + IS -> data = stdin; + else + IS -> data = fopen(s, "rb"); if (!IS -> data) {