summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorglenda@cirno <glenda@cirno>2015-06-25 23:00:02 -0700
committerglenda@cirno <glenda@cirno>2015-06-25 23:00:02 -0700
commit98972288339fd5d5f6466557e704f3737eab3c67 (patch)
tree47137ca93e63b5d0734e2c79e4edaf562df61f4a /libstd
parent0fb976c84f8eb424017c6ab6215a8e39cf14f727 (diff)
downloadmc-98972288339fd5d5f6466557e704f3737eab3c67.tar.gz
Export type info correctly on plan9
Diffstat (limited to 'libstd')
-rw-r--r--libstd/env+plan9.myr2
-rw-r--r--libstd/fmt.myr4
-rw-r--r--libstd/syswrap+plan9.myr2
3 files changed, 5 insertions, 3 deletions
diff --git a/libstd/env+plan9.myr b/libstd/env+plan9.myr
index cb051d4..4a95ed7 100644
--- a/libstd/env+plan9.myr
+++ b/libstd/env+plan9.myr
@@ -37,7 +37,7 @@ const getenv = {name
match envfind(name)
| `Some val: -> `Some val
| `None:
- s = bfmt(buf[:], "/env/%s", name)
+ s = bfmt(buf[:], "/env/{}", name)
match std.slurp(s)
| `Fail m: -> `None
| `Ok data:
diff --git a/libstd/fmt.myr b/libstd/fmt.myr
index ae7c9ee..2fba705 100644
--- a/libstd/fmt.myr
+++ b/libstd/fmt.myr
@@ -143,9 +143,10 @@ const sbfmt = {sb, fmt, args
}
const sbfmtv = {sb, fmt, ap -> size
- var nfmt, nparams, pl
+ var nfmt, nparams, pl, orig
var c, params, ty
+ orig = fmt
nparams = ap.tc.nelt
nfmt = 0
if !fmtmapinited
@@ -186,6 +187,7 @@ const sbfmtv = {sb, fmt, ap -> size
:fmtdone
;;
if nfmt != nparams
+ write(1, orig)
die("too many params for fmt\n")
;;
-> sb.len
diff --git a/libstd/syswrap+plan9.myr b/libstd/syswrap+plan9.myr
index 030772e..b18b8da 100644
--- a/libstd/syswrap+plan9.myr
+++ b/libstd/syswrap+plan9.myr
@@ -131,7 +131,7 @@ const getsysinfo = {si
si.system = getenvv("osname", "Plan9")
si.release = "4"
si.version = "0"
- si.arch = getenvv("objtype", "unknown")
+ si.arch = getenvv("objtype", "amd64")
}
const close = {fd; -> sys.close(fd castto(sys.fd)) castto(int64)}