X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Ffiles%2Ffilename_helper.pl;h=531dfa51c6b6522c4f21f509dbcd514937b4a104;hb=359e2d0985e617ad6de421bda835baf621523d97;hp=a55c53ba71dd1b416616e5e9d283ffc026cccadd;hpb=b322b6af756d6b19f46439c61b251dc2fad445ba;p=feisty_meow.git diff --git a/scripts/files/filename_helper.pl b/scripts/files/filename_helper.pl index a55c53ba..531dfa51 100644 --- a/scripts/files/filename_helper.pl +++ b/scripts/files/filename_helper.pl @@ -18,7 +18,7 @@ # version of the License. Please send any updates to "fred@gruntose.com". # ############################################################################### -require "importenv.pl"; +use Env qw(OS IS_MSYS); ############################################################################ @@ -233,34 +233,22 @@ sub unix_canonicalize { return &canonicalizer(@_, "/"); } -# similar to the normal unix version, but supports msys's weird paths. -sub msys_canonicalize { - return &canonicalizer(@_, "/", 1); -} - -# similar to the msys version, but services cygwin. -sub cygwin_canonicalize { - return &canonicalizer(@_, "/", 2); -} - - # this more general routine gets a directory separator passed in. it then # replaces all the separators with that one. - sub canonicalizer { local($directory_name) = $_[0]; local($dirsep) = $_[1]; - local($do_funky) = $_[2]; -#print "do funky is set to \"$do_funky\"\n"; #print "old dir name is \"$directory_name\"\n"; if ($OS =~ /win/i) { #somewhat abbreviated check; only catches windoze systems, not dos or os2. - if ($do_funky eq "1") { + # IS_MSYS is calculated by feisty meow scripts startup; it will be + # non-empty if this is the msys tool kit. + if (length($IS_MSYS) > 0) { # msys utilities version (http://www.mingw.org) $directory_name =~ s/^(.):[\\\/](.*)$/\/\1\/\2/; - } elsif ($do_funky eq "2") { + } else { # cygwin utilities version (http://www.cygwin.com) $directory_name =~ s/^(.):[\\\/](.*)$/\/cygdrive\/\1\/\2/; }