ref: e363cc6bdebc37d56a27cd4fc3d9b03db4c2d6d6
parent: a367763275faf9bbda3196f58998e9e74484a9a0
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Aug 29 21:00:57 EDT 2017
Fix some straggling Ordonly
--- a/lib/std/dir+plan9.myr
+++ b/lib/std/dir+plan9.myr
@@ -26,7 +26,7 @@
var fd
var dir
- match open(p, Ordonly)
+ match open(p, Oread)
| `Ok f: fd = f
| `Err e: -> `Err "couldn't open directory"
;;
--- a/lib/std/intparse.myr
+++ b/lib/std/intparse.myr
@@ -48,11 +48,14 @@
}
generic doparse = {s, isneg, base -> option(@a::(integral,numeric))
- var v
+ var c, v, i
var cv : int32
v = 0
- for c : std.bychar(s)
+ i = 0
+ while true
+ c = std.decode(s[i:])
+ i += std.charlen(c)
if c == '_'
continue
;;
--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -27,8 +27,8 @@
const Failmem : byte# = (-1 : byte#)
- const Oread : fdopt = (sys.Ordonly : fdopt)
- const Owrite : fdopt = (sys.Owronly : fdopt)
+ const Oread : fdopt = (sys.Oread : fdopt)
+ const Owrite : fdopt = (sys.Owrite : fdopt)
const Ordwr : fdopt = (sys.Ordwr : fdopt)
const Otrunc : fdopt = (sys.Otrunc : fdopt)
const Ocexec : fdopt = (sys.Ocexec : fdopt)
@@ -198,7 +198,7 @@
const mkdir = {path, mode;
var fd
- fd = sys.create(path, sys.Ordonly, sys.Dmdir | (mode : int))
+ fd = sys.create(path, sys.Oread, sys.Dmdir | (mode : int))
if fd < 0
-> lasterr()
;;
--- a/lib/std/syswrap-ss+plan9.myr
+++ b/lib/std/syswrap-ss+plan9.myr
@@ -22,7 +22,7 @@
const bgetcwd = {buf
var fd
- fd = sys.open(".", sys.Ordonly)
+ fd = sys.open(".", sys.Oread)
if fd < 0
-> (fd : errno)
;;