LONG rc;
SV *res;
char *subs = 0;
- int n = c;
+ int n = c, have_nl = 0;
+ char *ocmd = cmd, *s, *t;
incompartment++;
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);
pRexxDeregisterFunction(handlerNames[n]);
if (c)
Safefree(subs);
+ if (cmd != ocmd)
+ Safefree(cmd);
#if 0 /* Do we want to restore these? */
DosFreeModule(hRexxAPI);
DosFreeModule(hRexx);