--- nfo/perl/libs/shortcuts.pm 2003/02/22 17:19:36 1.4 +++ nfo/perl/libs/shortcuts.pm 2003/02/22 17:26:13 1.5 @@ -1,7 +1,10 @@ ## --------------------------------------------------------------------------- -## $Id: shortcuts.pm,v 1.4 2003/02/22 17:19:36 joko Exp $ +## $Id: shortcuts.pm,v 1.5 2003/02/22 17:26:13 joko Exp $ ## --------------------------------------------------------------------------- ## $Log: shortcuts.pm,v $ +## Revision 1.5 2003/02/22 17:26:13 joko +## + enhanced unix compatibility fix +## ## Revision 1.4 2003/02/22 17:19:36 joko ## + unix compatibility fix ## @@ -63,9 +66,14 @@ print " ", $caption, "\n" if $caption; print $sep, "\n"; - # fix for unix: prefix command with './' if no pathname (relative or absolute) included + # strip name of executable from full command string + $cmd =~ m/(.+?)\s/; + my $executable = $1; + + # for unix: check if executable is in local directory, if so - prefix with './' if (!RUNNING_IN_HELL()) { - if ($cmd !~ m/\//) { + #if ($cmd !~ m/\//) { + if (-e $executable) { $cmd = "./$cmd"; } }