Move to tabs for indentation and to 8-space notches, per style(9).
4 space indentation with a mix of tabs and spaces is a hassle. Update to project-standard hard-tabs with 8-space indentation in these files. This matches the new code coming in better as well.
This commit is contained in:
parent
2614eccf45
commit
16bb6523bc
@ -50,18 +50,19 @@ static char *args[MAXARGS];
|
||||
*/
|
||||
|
||||
#define PARSE_FAIL(expr) \
|
||||
if (expr) { \
|
||||
if (expr) { \
|
||||
printf("fail at line %d\n", __LINE__); \
|
||||
clean(); \
|
||||
free(copy); \
|
||||
free(buf); \
|
||||
return 1; \
|
||||
}
|
||||
}
|
||||
|
||||
/* Accept the usual delimiters for a variable, returning counterpart */
|
||||
static char
|
||||
isdelim(int ch)
|
||||
{
|
||||
|
||||
if (ch == '{')
|
||||
return '}';
|
||||
else if (ch == '(')
|
||||
@ -72,12 +73,14 @@ isdelim(int ch)
|
||||
static int
|
||||
isquote(int ch)
|
||||
{
|
||||
|
||||
return (ch == '\'');
|
||||
}
|
||||
|
||||
static int
|
||||
isdquote(int ch)
|
||||
{
|
||||
|
||||
return (ch == '"');
|
||||
}
|
||||
|
||||
@ -208,6 +211,7 @@ clean(void)
|
||||
static int
|
||||
insert(int *argcp, char *buf)
|
||||
{
|
||||
|
||||
if (*argcp >= MAXARGS)
|
||||
return 1;
|
||||
args[(*argcp)++] = strdup(buf);
|
||||
@ -217,6 +221,7 @@ insert(int *argcp, char *buf)
|
||||
static char *
|
||||
variable_lookup(char *name)
|
||||
{
|
||||
|
||||
/* XXX search "special variable" space first? */
|
||||
return (char *)getenv(name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user