Only use the last . for the suffix.
And don't try to be *too* special for .glue.c.
@@ -49,7 +49,7 @@ const srcsplit = {src
| `std.Some i: fbase = i
| `std.None: fbase = 0
;;
- match std.strfind(src[fbase:], ".")
+ match std.strrfind(src[fbase:], ".")
| `std.None: /* no suffix to trim */
| `std.Some i:
suff = src[fbase+i:]
@@ -69,12 +69,12 @@ const changesuffix = {src, new
var base, platf, suff
(base, platf, suff) = srcsplit(src)
- if std.hassuffix(suff, ".myr")
+ if std.hassuffix(src, ".myr")
-> std.strcat(base, new)
- elif std.hassuffix(suff, ".s")
+ elif std.hassuffix(src, ".s")
-> std.strcat(base, new)
- elif std.hassuffix(suff, ".glue.c")
- -> std.strjoin([base, ".glue", new][:], "")
+ elif std.hassuffix(src, ".glue.c")
+ -> std.strjoin([base, new][:], "")
elif std.hassuffix(src, ".o") || std.hassuffix(src, ".6")
-> std.sldup(src)
else
