-
Notifications
You must be signed in to change notification settings - Fork 89
Closed
Description
The following program worked just fine when compiled with GHC <9.8:
module Main (main) where
import System.Process
main :: IO ()
main = callProcess "echo" ["foo\0bar"]Compiled with GHC >=9.8 it outputs the following runtime error:
*** Exception: /usr/bin/echo: checkForInteriorNuls: invalid argument (FilePaths must not contain internal NUL code units.)
The reason is that process also treats the arguments as FilePath:
process/System/Process/Posix.hs
Line 139 in d74bba2
| withMany withFilePath (cmd:args) $ \cstrs -> |
The
System.Posix.Internals.withFilePath function referenced there checks for internal NULL characters since base >4.19 due to the accepted CLC propsal haskell/core-libraries-committee#144.Metadata
Metadata
Assignees
Labels
No labels