From 13310cf31ef3aa731ab76fc3f7880a6da085e50e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 18 Aug 2010 13:49:26 +0200 Subject: indexamajig: Don't ignore first item (can't rewind() stdin...) --- src/indexamajig.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/indexamajig.c') diff --git a/src/indexamajig.c b/src/indexamajig.c index d6b0d982..91abc9e1 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -647,7 +647,6 @@ int main(int argc, char *argv[]) ERROR("Failed to prepare indexing.\n"); return 1; } - rewind(fh); gsl_set_error_handler_off(); n_images = 0; @@ -669,8 +668,13 @@ int main(int argc, char *argv[]) pargs = worker_args[i]; - rval = fgets(line, 1023, fh); - if ( rval == NULL ) continue; + if ( strlen(prepare_line) > 0 ) { + strcpy(line, prepare_line); + prepare_line[0] = '\0'; + } else { + rval = fgets(line, 1023, fh); + if ( rval == NULL ) continue; + } chomp(line); snprintf(pargs->filename, 1023, "%s%s", prefix, line); -- cgit v1.2.3