View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000624 | Perl for OS/2 | Feature Request | public | 2014-09-11 12:22 | 2014-09-11 12:22 |
Reporter | komh | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Summary | 0000624: setmode() on stdin/stdout/stderr | ||||
Description | Hi/2. Currently, setmode() works on every file handle unconditionally. But if the handle is a console, it's better to set it to a text mode even if a binary mode is requested. In practice, a windows port of perl behave like this. In fact, MinGW. How about mimicing this ? | ||||
Tags | No tags attached. | ||||
Attached Files | 0001-Set-a-handle-to-a-text-mode-if-it-is-a-console.patch (633 bytes)
From fc4f98ac4e50adbaa94a4dcb4b4d1489f82d12ac Mon Sep 17 00:00:00 2001 From: KO Myung-Hun <komh@chollian.net> Date: Thu, 11 Sep 2014 11:42:47 +0900 Subject: [PATCH] Set a handle to a text mode if it is a console --- os2/os2ish.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/os2/os2ish.h b/os2/os2ish.h index a0f984b..3429bfb 100644 --- a/os2/os2ish.h +++ b/os2/os2ish.h @@ -472,6 +472,9 @@ char *ctermid(char *s); #define OP_BINARY O_BINARY +#define setmode(handle, mode) \ + (setmode((handle), isatty((handle)) ? O_TEXT : (mode))) + #define OS2_STAT_HACK 1 #if OS2_STAT_HACK -- 1.7.3.2 | ||||