diff options
author | harti <harti@FreeBSD.org> | 2005-02-10 14:39:05 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-02-10 14:39:05 +0000 |
commit | 1735ff6669ca8ed16a863a22389d49b1a5e8a221 (patch) | |
tree | 1c34bd675ae0911ed46c0772df85b61e31f351db /usr.bin/make | |
parent | 7e0569095f624d1af6eb91b17b4f77c472374224 (diff) | |
download | FreeBSD-src-1735ff6669ca8ed16a863a22389d49b1a5e8a221.zip FreeBSD-src-1735ff6669ca8ed16a863a22389d49b1a5e8a221.tar.gz |
Fix spacing by converting mixes of space and tab to tab. Also add a number
of empty lines in appropriate places.
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin/make')
-rw-r--r-- | usr.bin/make/arch.c | 8 | ||||
-rw-r--r-- | usr.bin/make/compat.c | 26 | ||||
-rw-r--r-- | usr.bin/make/for.c | 4 | ||||
-rw-r--r-- | usr.bin/make/var.c | 49 |
4 files changed, 46 insertions, 41 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index 79883f6..70c5d95 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -263,10 +263,10 @@ Arch_ParseArchive(char **linePtr, Lst *nodeLst, GNode *ctxt) * later. */ if (doSubst) { - char *buf; - char *sacrifice; - char *oldMemName = memName; - size_t sz; + char *buf; + char *sacrifice; + char *oldMemName = memName; + size_t sz; memName = Var_Subst(NULL, memName, ctxt, TRUE); diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 743bce7..badc43c 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -226,19 +226,19 @@ shellneed(char *cmd) int Compat_RunCommand(void *cmdp, void *gnp) { - char *cmdStart; /* Start of expanded command */ - char *cp; - Boolean silent, /* Don't print command */ - doit, /* Execute even in -n */ - errCheck; /* Check errors */ - int reason; /* Reason for child's death */ - int status; /* Description of child's death */ - int cpid; /* Child actually found */ - ReturnStatus rstat; /* Status of fork */ - LstNode *cmdNode; /* Node where current command is located */ - char **av; /* Argument vector for thing to exec */ - char *cmd = cmdp; - GNode *gn = gnp; + char *cmdStart; /* Start of expanded command */ + char *cp; + Boolean silent; /* Don't print command */ + Boolean doit; /* Execute even in -n */ + Boolean errCheck; /* Check errors */ + int reason; /* Reason for child's death */ + int status; /* Description of child's death */ + int cpid; /* Child actually found */ + ReturnStatus rstat; /* Status of fork */ + LstNode *cmdNode; /* Node where current command is located */ + char **av; /* Argument vector for thing to exec */ + char *cmd = cmdp; + GNode *gn = gnp; /* * Avoid clobbered variable warnings by forcing the compiler diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index d254e2e..fbbcc29 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -251,8 +251,8 @@ For_Eval(char *line) static int ForExec(void *namep, void *argp) { - char *name = namep; - For *arg = argp; + char *name = namep; + For *arg = argp; Var_Set(arg->var, name, VAR_GLOBAL); DEBUGF(FOR, ("--- %s = %s\n", arg->var, name)); diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 2cfade8..b5e996c 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -954,21 +954,21 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, size_t *lengthPtr, * replacing embedded variables as we go. */ for (tstr = str + 2; *tstr != '\0' && *tstr != endc && *tstr != ':'; tstr++) - if (*tstr == '$') { - size_t rlen; - Boolean rfree; - char* rval = Var_Parse(tstr, ctxt, err, &rlen, &rfree); - - if (rval == var_Error) { - Fatal("Error expanding embedded variable."); - } else if (rval != NULL) { - Buf_Append(buf, rval); - if (rfree) - free(rval); - } - tstr += rlen - 1; - } else - Buf_AddByte(buf, (Byte)*tstr); + if (*tstr == '$') { + size_t rlen; + Boolean rfree; + char *rval = Var_Parse(tstr, ctxt, err, &rlen, &rfree); + + if (rval == var_Error) { + Fatal("Error expanding embedded variable."); + } else if (rval != NULL) { + Buf_Append(buf, rval); + if (rfree) + free(rval); + } + tstr += rlen - 1; + } else + Buf_AddByte(buf, (Byte)*tstr); if (*tstr == '\0') { /* @@ -1118,6 +1118,7 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, size_t *lengthPtr, } else { v->flags |= VAR_IN_USE; } + /* * Before doing any modification, we have to make sure the value * has been fully expanded. If it looks like recursion might be @@ -1734,14 +1735,15 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, size_t *lengthPtr, char * Var_Subst(const char *var, char *str, GNode *ctxt, Boolean undefErr) { - Buffer *buf; /* Buffer for forming things */ - char *val; /* Value to substitute for a variable */ - size_t length; /* Length of the variable invocation */ - Boolean doFree; /* Set true if val should be freed */ + Buffer *buf; /* Buffer for forming things */ + char *val; /* Value to substitute for a variable */ + size_t length; /* Length of the variable invocation */ + Boolean doFree; /* Set true if val should be freed */ char *result; - static Boolean errorReported; /* Set true if an error has already - * been reported to prevent a plethora - * of messages when recursing */ + + static Boolean errorReported; /* Set true if an error has already + * been reported to prevent a plethora + * of messages when recursing */ buf = Buf_Init(MAKE_BSIZE); errorReported = FALSE; @@ -1767,6 +1769,7 @@ Var_Subst(const char *var, char *str, GNode *ctxt, Boolean undefErr) str++; } while (str[0] != '$' && str[0] != '\0'); Buf_AppendRange(buf, cp, str); + } else { /* * Variable invocation. @@ -1795,6 +1798,7 @@ Var_Subst(const char *var, char *str, GNode *ctxt, Boolean undefErr) *p != '$') { ++p; } + /* * A variable inside the variable. We cannot expand * the external variable yet, so we try again with @@ -1814,6 +1818,7 @@ Var_Subst(const char *var, char *str, GNode *ctxt, Boolean undefErr) */ for (;*p != '$' && *p != '\0'; p++) continue; + Buf_AppendRange(buf, str, p); str = p; expand = FALSE; |