ref: 9f068acd09e42ac29ca8643c13b6963d5f76a346
parent: 62f9c3a555ac291572917775f703460bc8fbc257
author: Ori Bernstein <ori@markovcorp.com>
date: Wed Mar 1 09:20:27 EST 2017
Only find suffixes and platforms in the file name. Ignore '+' and '.' in the path components leading up to the file name.
--- a/mbld/util.myr
+++ b/mbld/util.myr
@@ -59,22 +59,27 @@
}
const srcsplit = {src
- var platf, suff
+ var platf, fbase, suff
platf = ""
suff = ""
- match std.strfind(src, ".")
+
+ match std.strfind(src, "/")
+ | `std.Some i: fbase = i
+ | `std.None: fbase = 0
+ ;;
+ match std.strfind(src[fbase:], ".")
| `std.Some i:
- suff = src[i:]
- src = src[:i]
+ suff = src[fbase+i:]
+ src = src[:fbase+i]
| `std.None:
/* no suffix to trim */
;;
- match std.strrfind(src, "+")
+ match std.strrfind(src[fbase:], "+")
| `std.Some i:
- platf = src[i:]
- src = src[:i]
+ platf = src[fbase+i:]
+ src = src[:fbase+i]
| `std.None:
/* no platform to trim */
;;