[cig-commits] [commit] devel: added a safety statement to utils/clean_listings_specfem.pl (ead7503)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Jan 21 19:06:22 PST 2015


Repository : https://github.com/geodynamics/specfem3d

On branch  : devel
Link       : https://github.com/geodynamics/specfem3d/compare/2e68cd5def2c5a34fca4b51d417d1520faad97fb...ead7503830435986cefcd8d0dc21b97998cb1530

>---------------------------------------------------------------

commit ead7503830435986cefcd8d0dc21b97998cb1530
Author: Dimitri Komatitsch <komatitsch at lma.cnrs-mrs.fr>
Date:   Thu Jan 22 04:03:17 2015 +0100

    added a safety statement to utils/clean_listings_specfem.pl


>---------------------------------------------------------------

ead7503830435986cefcd8d0dc21b97998cb1530
 utils/clean_listings_specfem.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utils/clean_listings_specfem.pl b/utils/clean_listings_specfem.pl
index cdad1f0..c17948b 100755
--- a/utils/clean_listings_specfem.pl
+++ b/utils/clean_listings_specfem.pl
@@ -224,7 +224,8 @@
             print STDOUT "Cleaning $name ...\n";
 
 # this preserves file permissions of executable files
-            system("cp -p $name _____temp08_____ ; iconv -f utf-8 -t ASCII//TRANSLIT _____temp08_____ -o _____temp09_____ ; cp _____temp09_____ $name");
+# the second "cp" is there just to be safe: if "iconv" is not installed on a system, then the last "cp", if executed, will copy the file identical to itself
+            system("cp -p $name _____temp08_____ ; cp -p $name _____temp09_____ ; iconv -f utf-8 -t ASCII//TRANSLIT _____temp08_____ -o _____temp09_____ ; cp _____temp09_____ $name");
 
       }
 



More information about the CIG-COMMITS mailing list