summaryrefslogtreecommitdiff
path: root/os2/OS2
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>2002-12-13 06:08:00 -0800
committerhv <hv@crypt.org>2002-12-17 01:54:19 +0000
commitae2efb68622a795e5d137b8fd8181b67e74a58b9 (patch)
tree5561276d3a20a288470312bb8c026e2cb5dad66b /os2/OS2
parent9febdf04c602e91a389f75497c9add388bc632ec (diff)
downloadperl-ae2efb68622a795e5d137b8fd8181b67e74a58b9.tar.gz
OS/2 REXX interface assuming Object REXX
Message-ID: <20021213220800.GA2625@math.berkeley.edu> p4raw-id: //depot/perl@18313
Diffstat (limited to 'os2/OS2')
-rw-r--r--os2/OS2/REXX/REXX.xs22
1 files changed, 21 insertions, 1 deletions
diff --git a/os2/OS2/REXX/REXX.xs b/os2/OS2/REXX/REXX.xs
index c3ddcb4dbd..10ee7ece2b 100644
--- a/os2/OS2/REXX/REXX.xs
+++ b/os2/OS2/REXX/REXX.xs
@@ -72,7 +72,8 @@ exec_in_REXX_with(pTHX_ char *cmd, int c, char **handlerNames, RexxFunctionHandl
LONG rc;
SV *res;
char *subs = 0;
- int n = c;
+ int n = c, have_nl = 0;
+ char *ocmd = cmd, *s, *t;
incompartment++;
@@ -84,6 +85,23 @@ exec_in_REXX_with(pTHX_ char *cmd, int c, char **handlerNames, RexxFunctionHandl
subs[n] = 1;
}
+ s = cmd;
+ while (*s) {
+ if (*s == '\n') { /* Is not preceeded by \r! */
+ New(728, cmd, 2*strlen(cmd)+1, char);
+ s = ocmd;
+ t = cmd;
+ while (*s) {
+ if (*s == '\n')
+ *t++ = '\r';
+ *t++ = *s++;
+ }
+ *t = 0;
+ break;
+ } else if (*s == '\r')
+ s++;
+ s++;
+ }
MAKERXSTRING(args[0], NULL, 0);
MAKERXSTRING(inst[0], cmd, strlen(cmd));
MAKERXSTRING(inst[1], NULL, 0);
@@ -105,6 +123,8 @@ exec_in_REXX_with(pTHX_ char *cmd, int c, char **handlerNames, RexxFunctionHandl
pRexxDeregisterFunction(handlerNames[n]);
if (c)
Safefree(subs);
+ if (cmd != ocmd)
+ Safefree(cmd);
#if 0 /* Do we want to restore these? */
DosFreeModule(hRexxAPI);
DosFreeModule(hRexx);