Commit eb9ff560 authored by Peter Pentchev's avatar Peter Pentchev

test_hex: process stdin if "-" is specified

parent 08e87774
......@@ -9,6 +9,7 @@ Changelog for libdebug.
multibyte locales are much more common these days
- tests/Makefile: rebuild the executables if the library changes
- hex: fix hexdump_stub() for 16*n-byte blocks!
- test_hex: accept "-" as an alias for the standard input stream
0.4.4 2011/07/19
- fix a compiler warning about an unused variable in memory.c
......
......@@ -104,7 +104,9 @@ int main (int argc,char *argv[])
exit (EXIT_FAILURE);
}
if ((fd = open (argv[1],O_RDONLY)) < 0)
if (strcmp(argv[1], "-") == 0)
fd = 0;
else if ((fd = open (argv[1],O_RDONLY)) < 0)
{
log_printf (LOG_ERROR,"open %s: %m\n",argv[1]);
exit (EXIT_FAILURE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment