mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 02:52:24 +00:00
Remove redundant sync that causes error on windows. Update console for Windows cr/lf.
This commit is contained in:
parent
c2e97de495
commit
c93705920e
2 changed files with 11 additions and 3 deletions
|
|
@ -46,7 +46,7 @@ MODULE Console; (* J. Templ, 29-June-96 *)
|
||||||
END Int;
|
END Int;
|
||||||
|
|
||||||
PROCEDURE Ln*;
|
PROCEDURE Ln*;
|
||||||
BEGIN Char(0AX); (* Unix end-of-line *)
|
BEGIN String(Platform.NL);
|
||||||
END Ln;
|
END Ln;
|
||||||
|
|
||||||
PROCEDURE Bool*(b: BOOLEAN);
|
PROCEDURE Bool*(b: BOOLEAN);
|
||||||
|
|
@ -75,7 +75,12 @@ MODULE Console; (* J. Templ, 29-June-96 *)
|
||||||
VAR i: LONGINT; ch: CHAR;
|
VAR i: LONGINT; ch: CHAR;
|
||||||
BEGIN Flush();
|
BEGIN Flush();
|
||||||
i := 0; Read(ch);
|
i := 0; Read(ch);
|
||||||
WHILE (i < LEN(line) - 1) & (ch # 0AX) & (ch # 0X) DO line[i] := ch; INC(i); Read(ch) END ;
|
WHILE (i < LEN(line) - 1)
|
||||||
|
& (ch # 0AX)
|
||||||
|
& (ch # 0X) DO
|
||||||
|
line[i] := ch; INC(i); Read(ch)
|
||||||
|
END;
|
||||||
|
IF (i > 0) & (line[i-1] = 0DX) THEN DEC(i) END; (* Swallow CR before LF *)
|
||||||
line[i] := 0X
|
line[i] := 0X
|
||||||
END ReadLine;
|
END ReadLine;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -215,8 +215,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files
|
||||||
IF (f.state # create) OR (f.registerName # "") THEN
|
IF (f.state # create) OR (f.registerName # "") THEN
|
||||||
Create(f); i := 0;
|
Create(f); i := 0;
|
||||||
WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END;
|
WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END;
|
||||||
|
(* There's no reason to sync this file - we're about to close it. The OS
|
||||||
|
will sync if necessary. Further, sync will fail for a R/O file on Windows.
|
||||||
error := Platform.Sync(f.fd);
|
error := Platform.Sync(f.fd);
|
||||||
IF error # 0 THEN Err("error writing file", f, error) END;
|
IF error # 0 THEN Err("error syncing file", f, error) END;
|
||||||
|
*)
|
||||||
CloseOSFile(f);
|
CloseOSFile(f);
|
||||||
END
|
END
|
||||||
END Close;
|
END Close;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue