2408 |
{ |
{ |
2409 |
/* Backslash-newline is handled differently depending on what |
/* Backslash-newline is handled differently depending on what |
2410 |
kind of string we're in: inside single-quoted strings you |
kind of string we're in: inside single-quoted strings you |
2411 |
keep them; in double-quoted strings they disappear. */ |
keep them; in double-quoted strings they disappear. |
2412 |
if (instring == '"') |
For DOS/Windows/OS2, if we don't have a POSIX shell, |
2413 |
|
we keep the pre-POSIX behavior of removing the |
2414 |
|
backslash-newline. */ |
2415 |
|
if (instring == '"' |
2416 |
|
#if defined (__MSDOS__) || defined (__EMX__) || defined (WINDOWS32) |
2417 |
|
|| !unixy_shell |
2418 |
|
#endif |
2419 |
|
) |
2420 |
++p; |
++p; |
2421 |
else |
else |
2422 |
{ |
{ |
2700 |
} |
} |
2701 |
else if (*p == '\\' && p[1] == '\n') |
else if (*p == '\\' && p[1] == '\n') |
2702 |
{ |
{ |
2703 |
/* POSIX says we keep the backslash-newline, but throw out the |
/* POSIX says we keep the backslash-newline, but throw out |
2704 |
next char if it's a TAB. */ |
the next char if it's a TAB. If we don't have a POSIX |
2705 |
*(ap++) = '\\'; |
shell on DOS/Windows/OS2, mimic the pre-POSIX behavior |
2706 |
*(ap++) = *(p++); |
and remove the backslash/newline. */ |
2707 |
*(ap++) = *p; |
#if defined (__MSDOS__) || defined (__EMX__) || defined (WINDOWS32) |
2708 |
|
# define PRESERVE_BSNL unixy_shell |
2709 |
|
#else |
2710 |
|
# define PRESERVE_BSNL 1 |
2711 |
|
#endif |
2712 |
|
if (PRESERVE_BSNL) |
2713 |
|
{ |
2714 |
|
*(ap++) = '\\'; |
2715 |
|
*(ap++) = '\\'; |
2716 |
|
*(ap++) = '\n'; |
2717 |
|
} |
2718 |
|
|
2719 |
|
++p; |
2720 |
if (p[1] == '\t') |
if (p[1] == '\t') |
2721 |
++p; |
++p; |
2722 |
|
|