summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-12-12 13:32:05 -0800
committerOri Bernstein <ori@markovcorp.com>2017-12-12 13:33:08 -0800
commit9543bdfe516ddde6d347bffed6a99c9ec5c0c40b (patch)
treeec60dc279561e0cc0234983d74a8039698416952 /mbld
parent161c6c97e8accf066479a9c217c9c6cad4259850 (diff)
downloadmc-9543bdfe516ddde6d347bffed6a99c9ec5c0c40b.tar.gz
Only use the last . for the suffix.
And don't try to be *too* special for .glue.c.
Diffstat (limited to 'mbld')
-rw-r--r--mbld/util.myr10
1 files changed, 5 insertions, 5 deletions
diff --git a/mbld/util.myr b/mbld/util.myr
index bef6321..46fb462 100644
--- a/mbld/util.myr
+++ b/mbld/util.myr
@@ -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