Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When "-" is used for standard input, the filename in the context/unified headers should be "-", not "/dev/stdin" #46

Closed
oSoMoN opened this issue Apr 3, 2024 · 0 comments

Comments

@oSoMoN
Copy link
Collaborator

oSoMoN commented Apr 3, 2024

When passing in "-" as a parameter on the CLI invokation to use the standard input for either of the input files, in conjunction with the -c or -u options, the filenames displayed should be "-", not "/dev/stdin", to be consistent with GNU's implementation:

echo foo > foo

echo bar | /usr/bin/diff -u foo -
--- foo	2024-04-03 18:55:48.837847038 +0200
+++ -	2024-04-03 18:58:47.031319515 +0200
@@ -1 +1 @@
-foo
+bar

echo bar | cargo run --release -- -u foo -
--- foo	
+++ /dev/stdin	
@@ -1 +1 @@
-foo
+bar
oSoMoN added a commit to oSoMoN/uutils-diffutils that referenced this issue Apr 3, 2024
sylvestre pushed a commit to oSoMoN/uutils-diffutils that referenced this issue Apr 4, 2024
sylvestre added a commit that referenced this issue Apr 9, 2024
Handle the rewrite of "-" to "/dev/stdin" in main to leave the filenames unchanged (fixes #46)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant