haskell / c2hs

c2hs is a pre-processor for Haskell FFI bindings to C libraries
http://hackage.haskell.org/package/c2hs
Other
199 stars 50 forks source link

Never pass empty arguments to cpp. #221

Closed TravisWhitaker closed 5 years ago

TravisWhitaker commented 5 years ago

If the args list contains any empty strings, these will be emitted as empty spaces in the argument list. runProcess will pass these to the cpp executable as real empty string arguments, and some cpp implementations don't handle this well. For example, an implementation I'm stuck using somehow treats this empty argument as the input file name and fails when it's not found. Filtering out null strings from the argument list fixes this.

TravisWhitaker commented 5 years ago

@deech @kolmodin any reason to not merge this?

deech commented 5 years ago

Merged, sorry for the delay. Somehow I'm not getting notified of PRs and issues.

TravisWhitaker commented 5 years ago

Thanks!