Commit caf65a4e authored by conrad's avatar conrad

add ability to run oggz-validate on stdin, using "-" as filename

 + also don't exit(1) immediately on failed oggz_open, continue processing
other files on commandline


git-svn-id: http://svn.annodex.net/liboggz/trunk@1968 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent a016af4e
......@@ -289,9 +289,14 @@ validate (char * filename)
/*printf ("oggz-validate: %s\n", filename);*/
if ((reader = oggz_open (filename, OGGZ_READ|OGGZ_AUTO)) == NULL) {
if (!strncmp (filename, "-", 2)) {
if ((reader = oggz_open_stdio (stdin, OGGZ_READ|OGGZ_AUTO)) == NULL) {
fprintf (stderr, "oggz-validate: unable to open stdin\n");
return -1;
}
} else if ((reader = oggz_open (filename, OGGZ_READ|OGGZ_AUTO)) == NULL) {
fprintf (stderr, "oggz-validate: unable to open file %s\n", filename);
exit (1);
return -1;
}
ovdata_init (&ovdata);
......@@ -396,7 +401,8 @@ main (int argc, char ** argv)
for (; i < argc; i++) {
filename = argv[i];
validate (filename);
if (validate (filename) == -1)
exit_status = 1;
}
exit_out:
......
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