summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@foo.hsd1.ca.comcast.net>2016-09-23 16:07:15 -0700
committerOri Bernstein <ori@foo.hsd1.ca.comcast.net>2016-09-23 16:07:15 -0700
commit25bdeed20e3d0915bca71d488b9d7bcda07c4109 (patch)
treedaa1a596a524b4c69a277b43bc2c935cffad3389
parent6109f4b305d077fa88ab65fbdc728527ef4478d9 (diff)
downloadmc-25bdeed20e3d0915bca71d488b9d7bcda07c4109.tar.gz
Use the first dot as the suffix.
Support for .glue.c; maybe we can do better.
-rw-r--r--mbld/util.myr4
-rw-r--r--test/fmtalign.myr2
2 files changed, 3 insertions, 3 deletions
diff --git a/mbld/util.myr b/mbld/util.myr
index 498d82d..443d127 100644
--- a/mbld/util.myr
+++ b/mbld/util.myr
@@ -53,7 +53,7 @@ const srcsplit = {src
platf = ""
suff = ""
- match std.strrfind(src, ".")
+ match std.strfind(src, ".")
| `std.Some i:
suff = src[i:]
src = src[:i]
@@ -86,7 +86,7 @@ const srcswapsuffix = {src, new
-> std.strcat(base, new)
elif std.hassuffix(suff, ".s")
-> std.strcat(base, new)
- elif std.hassuffix(suff, ".glue.c")
+ elif std.hassuffix(base, ".glue.c")
-> std.strjoin([base, ".glue", new][:], "")
else
std.fatal("unrecognized source {}\n", src)
diff --git a/test/fmtalign.myr b/test/fmtalign.myr
index 9ae3464..37b0564 100644
--- a/test/fmtalign.myr
+++ b/test/fmtalign.myr
@@ -12,6 +12,6 @@ pkg =
const main = {
var msg=`Tversion [.tag=45, .version="9P2000"]
- std.fmt("{}\n", msg)
+ std.put("{}\n", msg)
}