summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2011-10-27 18:50:33 +0000
committerChristopher Michael <cpmichael1@comcast.net>2011-10-27 18:50:33 +0000
commita5a60a3ef28fc87889b320159ac27a7a9f2cda96 (patch)
tree0e016321832d5e83c0c08fe50685a54df1c81971
parentc77c08ac9b347e42cc021ffeeb2a7cafdd031656 (diff)
Emprint: Don't duplicate extension onto the filename if not needed.
SVN revision: 64442
-rw-r--r--src/bin/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index f0f8d1e..5103bfc 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -303,10 +303,6 @@ _em_get_filename(void)
303 ext = strrchr(file, '.'); 303 ext = strrchr(file, '.');
304 if (!ext) ext = strdup(".png"); 304 if (!ext) ext = strdup(".png");
305 305
306 /* strip any %N out of filename */
307 p = strrchr(file, '%');
308 if (p) *p = 0;
309
310 /* filename was given, check for '%' signs to 306 /* filename was given, check for '%' signs to
311 * format based on strftime or file count */ 307 * format based on strftime or file count */
312 if ((strstr(opts->filename, "%")) && 308 if ((strstr(opts->filename, "%")) &&
@@ -316,6 +312,10 @@ _em_get_filename(void)
316 { 312 {
317 int c = 0; 313 int c = 0;
318 314
315 /* strip any %N out of filename */
316 p = strrchr(file, '%');
317 if (p) *p = 0;
318
319 c = _em_get_filecount(filename); 319 c = _em_get_filecount(filename);
320 320
321 if (c > 0) 321 if (c > 0)
@@ -324,7 +324,7 @@ _em_get_filename(void)
324 snprintf(buf, sizeof(buf), "%s/%s%s", dir, file, ext); 324 snprintf(buf, sizeof(buf), "%s/%s%s", dir, file, ext);
325 } 325 }
326 else 326 else
327 snprintf(buf, sizeof(buf), "%s/%s%s", dir, file, ext); 327 snprintf(buf, sizeof(buf), "%s/%s", dir, file);
328 } 328 }
329 } 329 }
330 330