patch 9.1.0857: xxd: --- is incorrectly recognized as end-of-options
Problem: xxd: --- is incorrectly recognized as end-of-options
Solution: improve xxds end-of-option parser (DungSaga)
closes: #9285
Signed-off-by: DungSaga <dungsaga@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c
index b1050e9..c222885 100644
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -65,6 +65,7 @@
* 10.05.2024 fix another buffer-overflow when writing colored output to buffer, #14738
* 10.09.2024 Support -b and -i together, #15661
* 19.10.2024 -e did add an extra space #15899
+ * 11.11.2024 improve end-of-options argument parser #9285
*
* (c) 1990-1998 by Juergen Weigert (jnweiger@gmail.com)
*
@@ -145,7 +146,7 @@
# endif
#endif
-char version[] = "xxd 2024-10-19 by Juergen Weigert et al.";
+char version[] = "xxd 2024-11-11 by Juergen Weigert et al.";
#ifdef WIN32
char osver[] = " (Win32)";
#else
@@ -843,7 +844,7 @@
else
exit_with_usage();
}
- else if (!strcmp(pp, "--")) /* end of options */
+ else if (!strcmp(argv[1], "--")) /* end of options */
{
argv++;
argc--;