aboutsummaryrefslogtreecommitdiff
path: root/src/im-sandbox.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-11-26 05:14:57 -0800
committerThomas White <taw@physics.org>2014-05-08 17:52:02 +0200
commit1bc44dd21dc49a3920431cfee4495a28a45df622 (patch)
tree951831597e5a1503f4e83eaf4a363bac41528056 /src/im-sandbox.c
parent2400441598cd7876949f6b1ed52c14b6e469368c (diff)
Strip out the "prepare_filename" rubbish
Diffstat (limited to 'src/im-sandbox.c')
-rw-r--r--src/im-sandbox.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index 2c6e44ee..3558c8ea 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -124,8 +124,7 @@ static void unlock_sandbox(struct sandbox *sb)
}
-static char *get_pattern(FILE *fh, char **use_this_one_instead,
- int config_basename, const char *prefix)
+static char *get_pattern(FILE *fh, int config_basename, const char *prefix)
{
char *line;
char *filename;
@@ -134,22 +133,13 @@ static char *get_pattern(FILE *fh, char **use_this_one_instead,
do {
/* Get the next filename */
- if ( *use_this_one_instead != NULL ) {
-
- line = *use_this_one_instead;
- *use_this_one_instead = NULL;
-
- } else {
-
- char *rval;
-
- line = malloc(1024*sizeof(char));
- rval = fgets(line, 1023, fh);
- if ( rval == NULL ) {
- free(line);
- return NULL;
- }
+ char *rval;
+ line = malloc(1024*sizeof(char));
+ rval = fgets(line, 1023, fh);
+ if ( rval == NULL ) {
+ free(line);
+ return NULL;
}
chomp(line);
@@ -627,7 +617,7 @@ static void handle_zombie(struct sandbox *sb)
void create_sandbox(struct index_args *iargs, int n_proc, char *prefix,
- int config_basename, FILE *fh, char *use_this_one_instead,
+ int config_basename, FILE *fh,
int ofd, int argc, char *argv[], const char *tempdir)
{
int i;
@@ -853,8 +843,7 @@ void create_sandbox(struct index_args *iargs, int n_proc, char *prefix,
}
/* Send next filename */
- nextImage = get_pattern(fh, &use_this_one_instead,
- config_basename, prefix);
+ nextImage = get_pattern(fh, config_basename, prefix);
free(sb->last_filename[i]);
sb->last_filename[i] = nextImage;