Skip to content

Instantly share code, notes, and snippets.

@moustaki
Created June 27, 2012 17:07
Show Gist options
  • Save moustaki/3005431 to your computer and use it in GitHub Desktop.
Save moustaki/3005431 to your computer and use it in GitHub Desktop.
diff --git a/src/main.cxx b/src/main.cxx
index 8b2b389..062d0aa 100644
--- a/src/main.cxx
+++ b/src/main.cxx
@@ -230,11 +230,11 @@ int main(int argc, char** argv) {
int start_offset = 0;
int duration = 0;
int already = 0;
- if (argc > 2) start_offset = atoi(argv[2]);
- if (argc > 3) duration = atoi(argv[3]);
- if (argc > 4) already = atoi(argv[4]);
// If you give it -s, it means to read in a list of files from stdin.
if (strcmp(filename, "-s") == 0) {
+ if (argc > 2) start_offset = atoi(argv[2]);
+ if (argc > 3) duration = atoi(argv[3]);
+ if (argc > 4) already = atoi(argv[4]);
while(cin) {
if (count < MAX_FILES) {
string temp_str;
@@ -245,7 +245,12 @@ int main(int argc, char** argv) {
throw std::runtime_error("Too many files on stdin to process\n");
}
}
- } else files[count++] = filename;
+ } else {
+ if (argc > 3) start_offset = atoi(argv[3]);
+ if (argc > 4) duration = atoi(argv[4]);
+ if (argc > 5) already = atoi(argv[5]);
+ files[count++] = filename;
+ }
if(count == 0) throw std::runtime_error("No files given.\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment