diff options
author | ru <ru@FreeBSD.org> | 2004-01-10 16:30:29 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2004-01-10 16:30:29 +0000 |
commit | 839e89222771c4a8132fec92b350b1b839c33500 (patch) | |
tree | 22cb5118d451295f14e6dbcc15d9435b68893b6a /usr.bin | |
parent | a7dfeddaf71a4aed5fe726f8c05dbbede942c6e6 (diff) | |
download | FreeBSD-src-839e89222771c4a8132fec92b350b1b839c33500.zip FreeBSD-src-839e89222771c4a8132fec92b350b1b839c33500.tar.gz |
Moved the code for :U and :L modifiers where it belongs, so that
the fallback for SysV (now in POSIX) variable substitution works
for old_string arguments starting with 'U' or 'L'.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/var.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index bbc8270..716c147 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1160,38 +1160,6 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, int *lengthPtr, Boolean *freePtr) DEBUGF(VAR, ("Applying :%c to \"%s\"\n", *tstr, str)); switch (*tstr) { - case 'U': - if (tstr[1] == endc || tstr[1] == ':') { - Buffer buf; - buf = Buf_Init(MAKE_BSIZE); - for (cp = str; *cp ; cp++) - Buf_AddByte(buf, (Byte) toupper(*cp)); - - Buf_AddByte(buf, (Byte) '\0'); - newStr = (char *) Buf_GetAll(buf, (int *) NULL); - Buf_Destroy(buf, FALSE); - - cp = tstr + 1; - termc = *cp; - break; - } - /* FALLTHROUGH */ - case 'L': - if (tstr[1] == endc || tstr[1] == ':') { - Buffer buf; - buf = Buf_Init(MAKE_BSIZE); - for (cp = str; *cp ; cp++) - Buf_AddByte(buf, (Byte) tolower(*cp)); - - Buf_AddByte(buf, (Byte) '\0'); - newStr = (char *) Buf_GetAll(buf, (int *) NULL); - Buf_Destroy(buf, FALSE); - - cp = tstr + 1; - termc = *cp; - break; - } - /* FALLTHROUGH */ case 'N': case 'M': { @@ -1494,6 +1462,22 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, int *lengthPtr, Boolean *freePtr) free(pattern.matches); break; } + case 'L': + if (tstr[1] == endc || tstr[1] == ':') { + Buffer buf; + buf = Buf_Init(MAKE_BSIZE); + for (cp = str; *cp ; cp++) + Buf_AddByte(buf, (Byte) tolower(*cp)); + + Buf_AddByte(buf, (Byte) '\0'); + newStr = (char *) Buf_GetAll(buf, (int *) NULL); + Buf_Destroy(buf, FALSE); + + cp = tstr + 1; + termc = *cp; + break; + } + /* FALLTHROUGH */ case 'O': if (tstr[1] == endc || tstr[1] == ':') { newStr = VarSortWords(str, SortIncreasing); @@ -1518,6 +1502,22 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, int *lengthPtr, Boolean *freePtr) break; } /*FALLTHRU*/ + case 'U': + if (tstr[1] == endc || tstr[1] == ':') { + Buffer buf; + buf = Buf_Init(MAKE_BSIZE); + for (cp = str; *cp ; cp++) + Buf_AddByte(buf, (Byte) toupper(*cp)); + + Buf_AddByte(buf, (Byte) '\0'); + newStr = (char *) Buf_GetAll(buf, (int *) NULL); + Buf_Destroy(buf, FALSE); + + cp = tstr + 1; + termc = *cp; + break; + } + /* FALLTHROUGH */ case 'H': if (tstr[1] == endc || tstr[1] == ':') { newStr = VarModify (str, VarHead, (void *)0); |