Fix cross compilation suffix detection
authorKeno Fischer <kfischer+github@college.harvard.edu>
Mon, 5 Oct 2015 04:58:07 +0000 (00:58 -0400)
committerKeno Fischer <kfischer+github@college.harvard.edu>
Mon, 5 Oct 2015 04:58:07 +0000 (00:58 -0400)
If the path involves `-`, this would have otherwise detected this as a cross compile suffix.

c_check

diff --git a/c_check b/c_check
index 0fdadb6..d694e74 100644 (file)
--- a/c_check
+++ b/c_check
@@ -30,7 +30,7 @@ if ($ARGV[0] =~ /(.*)(-[.\d]+)/) {
        $cross_suffix = $1;
     }
 } else {
-    if ($ARGV[0] =~ /(.*-)(.*)/) {
+    if ($ARGV[0] =~ /([^\/]*-)([^\/]*$)/) {
        $cross_suffix = $1;
     }
 }