|
Lines 1428-1433
Link Here
|
| 1428 |
* (pathname minus the suffix). |
1428 |
* (pathname minus the suffix). |
| 1429 |
* :lhs=rhs Like :S, but the rhs goes to the end of |
1429 |
* :lhs=rhs Like :S, but the rhs goes to the end of |
| 1430 |
* the invocation. |
1430 |
* the invocation. |
|
|
1431 |
* :Q Quotes every shell meta-character in the |
| 1432 |
* variable |
| 1433 |
* :U Converts variable to UPPER-CASE |
| 1434 |
* :L Converts variable to lower-case |
| 1431 |
*/ |
1435 |
*/ |
| 1432 |
if ((str != (char *)NULL) && haveModifier) { |
1436 |
if ((str != (char *)NULL) && haveModifier) { |
| 1433 |
/* |
1437 |
/* |
|
Lines 1442-1447
Link Here
|
| 1442 |
printf("Applying :%c to \"%s\"\n", *tstr, str); |
1446 |
printf("Applying :%c to \"%s\"\n", *tstr, str); |
| 1443 |
} |
1447 |
} |
| 1444 |
switch (*tstr) { |
1448 |
switch (*tstr) { |
|
|
1449 |
case 'U': |
| 1450 |
if (tstr[1] == endc || tstr[1] == ':') { |
| 1451 |
/* XXX are there more effective way of doing the |
| 1452 |
same thing ?*/ |
| 1453 |
Buffer buf; |
| 1454 |
buf = Buf_Init (MAKE_BSIZE); |
| 1455 |
for (cp = str; *cp; cp++) |
| 1456 |
Buf_AddByte(buf, (Byte)toupper(*cp)); |
| 1457 |
|
| 1458 |
Buf_AddByte(buf, (Byte) '\0'); |
| 1459 |
newStr = (char *)Buf_GetAll (buf, (int *)NULL); |
| 1460 |
Buf_Destroy (buf, FALSE); |
| 1461 |
|
| 1462 |
cp = tstr + 1; |
| 1463 |
termc = *cp; |
| 1464 |
break; |
| 1465 |
} |
| 1466 |
/*FALLTHRU*/ |
| 1467 |
case 'L': |
| 1468 |
if (tstr[1] == endc || tstr[1] == ':') { |
| 1469 |
/* XXX are there more effective way of doing the |
| 1470 |
same thing ?*/ |
| 1471 |
Buffer buf; |
| 1472 |
buf = Buf_Init (MAKE_BSIZE); |
| 1473 |
for (cp = str; *cp; cp++) |
| 1474 |
Buf_AddByte(buf, (Byte)tolower(*cp)); |
| 1475 |
|
| 1476 |
Buf_AddByte(buf, (Byte) '\0'); |
| 1477 |
newStr = (char *)Buf_GetAll (buf, (int *)NULL); |
| 1478 |
Buf_Destroy (buf, FALSE); |
| 1479 |
|
| 1480 |
cp = tstr + 1; |
| 1481 |
termc = *cp; |
| 1482 |
break; |
| 1483 |
} |
| 1484 |
/*FALLTHRU*/ |
| 1445 |
case 'N': |
1485 |
case 'N': |
| 1446 |
case 'M': |
1486 |
case 'M': |
| 1447 |
{ |
1487 |
{ |
| 1448 |
-cutline-- |
|
|