-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
The codebase contains a sed command that doesn't work uniformly across different operating systems, specifically GNU/Linux and macOS. The incompatibility leads to an error message:
sed: 1: "tmp/errorBash.tmp": undefined label 'mp/errorBash.tmp'
The line in question is in src/test.c, line 108
system("sed -i 's/bash/pipex/g' tmp/errorBash.tmp");
On macOS, the syntax for in-place editing with sed requires an additional argument to specify the file extension for backups.
I fixed it with
system("sed -i '' 's/bash/pipex/g' tmp/errorBash.tmp");
A possible fix would to use preprocessor directives to detect the operating system at compile time and choose the correct syntax accordingly. If I run the test in francinette everything works smoothly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels