Enlightenment CVS committal Author : devilhorns Project : e17 Module : apps/emprint
Dir : e17/apps/emprint/src/bin Modified Files: main.c Log Message: Fix small emprint bugsie where if you didn't pass in an extension, it wasn't taking the screenshots. Now it will check for prefix and if missing it will apply .png to the filename & take the shot. =================================================================== RCS file: /cvs/e/e17/apps/emprint/src/bin/main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- main.c 18 Jan 2008 19:41:03 -0000 1.10 +++ main.c 25 Jan 2008 01:26:23 -0000 1.11 @@ -336,24 +336,36 @@ /* destroy the file list */ if (fl) ecore_list_destroy(fl); - /* assemble new filename based on count */ + /* strip the extension from filename */ + file = ecore_file_strip_ext(opts->filename); + + /* get the actual extension */ + ext = strrchr(opts->filename, '.'); + if (!ext) ext = strdup(".png"); + if (c > 0) { c++; - - /* strip the extension from filename */ - file = ecore_file_strip_ext(opts->filename); - - /* get the actual extension */ - ext = strrchr(opts->filename, '.'); - if (!ext) ext = strdup(".png"); - /* assemble new filename */ snprintf(buf, sizeof(buf), "%s%i%s", file, c, ext); } - else return; + else + { + /* assemble new filename */ + snprintf(buf, sizeof(buf), "%s%s", file, ext); + } } - else return; + else + { + /* strip the extension from filename */ + file = ecore_file_strip_ext(opts->filename); + + ext = strrchr(opts->filename, '.'); + if (!ext) ext = strdup(".png"); + + /* assemble new filename */ + snprintf(buf, sizeof(buf), "%s%s", file, ext); + } } } } ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs