Change 18313 by [EMAIL PROTECTED] on 2002/12/17 01:54:19

        Subject: [PATCH 5.8.1 @oldish-18156] OS/2 REXX interface assuming Object REXX
        From: Ilya Zakharevich <[EMAIL PROTECTED]>
        Date: Fri, 13 Dec 2002 14:08:00 -0800
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/os2/OS2/REXX/REXX.xs#16 edit

Differences ...

==== //depot/perl/os2/OS2/REXX/REXX.xs#16 (text) ====
Index: perl/os2/OS2/REXX/REXX.xs
--- perl/os2/OS2/REXX/REXX.xs#15~13183~ Wed Nov 21 14:33:20 2001
+++ perl/os2/OS2/REXX/REXX.xs   Mon Dec 16 17:54:19 2002
@@ -72,7 +72,8 @@
     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 @@
            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 @@
            pRexxDeregisterFunction(handlerNames[n]);
     if (c)
        Safefree(subs);
+    if (cmd != ocmd)
+       Safefree(cmd);
 #if 0                                  /* Do we want to restore these? */
     DosFreeModule(hRexxAPI);
     DosFreeModule(hRexx);
End of Patch.

Reply via email to