From 839e89222771c4a8132fec92b350b1b839c33500 Mon Sep 17 00:00:00 2001 From: ru Date: Sat, 10 Jan 2004 16:30:29 +0000 Subject: 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'. --- usr.bin/make/var.c | 64 +++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'usr.bin') 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); -- cgit v1.1