- Timestamp:
- Mar 1, 2009 7:55:50 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/expand.c
r2304 r2306 419 419 int saveherefd; 420 420 int quotes = flag & (EXP_FULL | EXP_CASE); 421 #ifdef SH_DEAL_WITH_CRLF 422 int pending_cr = 0; 423 #endif 421 424 422 425 INTOFF; … … 448 451 } 449 452 lastc = *p++; 453 #ifdef SH_DEAL_WITH_CRLF 454 if (pending_cr) { 455 pending_cr = 0; 456 if (lastc != '\n') { 457 if (quotes && syntax[(int)'\r'] == CCTL) 458 STPUTC(psh, CTLESC, dest); 459 STPUTC(psh, '\r', dest); 460 } 461 } 462 if (lastc == '\r') 463 pending_cr = '\r'; 464 else 465 #endif 450 466 if (lastc != '\0') { 451 467 if (quotes && syntax[(int)lastc] == CCTL) … … 454 470 } 455 471 } 472 #ifdef SH_DEAL_WITH_CRLF 473 if (pending_cr) { 474 if (quotes && syntax[(int)'\r'] == CCTL) 475 STPUTC(psh, CTLESC, dest); 476 STPUTC(psh, '\r', dest); 477 } 478 #endif 456 479 457 480 /* Eat all trailing newlines */ 458 481 p = stackblock(psh) + startloc; 459 while (dest > p && dest[-1] == '\n') {482 while (dest > p && dest[-1] == '\n') 460 483 STUNPUTC(psh, dest); 461 #ifdef SH_DEAL_WITH_CRLF462 if (dest > p && dest[-1] == '\r')463 STUNPUTC(psh, dest);464 #endif465 }466 484 467 485 if (in.fd >= 0)
Note:
See TracChangeset
for help on using the changeset viewer.