Remove unreachable code for VAR_NOSUBST - it was never set.
Replace redundant code with calls to VarGetPattern().
Patch: 7.143-7.145
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Change the parsing of the C modifier flags so that specifying both
'1' and 'g' gives an error.
Patch: 7.141,7.142
Submitted by: Max Okumoto <okumoto@ucsd.edu>
is always a '$'. This is not always correct, for example for
conditionals: .if defined(foobar).
Clean up some comments.
Move common code out of if-statements.
Patch: 7.140
Submitted by: Max Okumoto <okumoto@ucsd.edu>
by the caller. Don't pass 'endc' - it can be computed from 'startc'.
Remove unneccessary temporary variables. Remove constant if-expressions
and remove code before call Fatal() - there is no point to cleanup before
aborting.
Patch: 7.134,7.135
Submitted by: Max Okumoto <okumoto@ucsd.edu>
occurence which actually holds always the same constant value.
Shorten the name pattern to patt.
Patch: 7.133
Submitted by: Max Okumoto <okumoto@ucsd.edu>
by putting them into struct VarParser or computing them (consumed).
Change the loop termination condition in VarParseLong from endc to \0.
Patch: 7.128-7.132
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Reduce the number of arguments passed between these functions by
creating a special-purpose struct.
Patch: 7.120,7.121
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Rename result variable so common code becomes more visible.
Rename freePtr to freeResult to make clear what pointer must be freed.
Patch: 7.116, 7.116a
Submitted by: Max Okumoto <okumoto@ucsd.edu>
the loop. Add a comment why the 'consumed' variable is updated.
Rename lengthPtr to consumed.
Patch: 7.115
Submitted by: Max Okumoto <okumoto@ucsd.edu>
ParseRestModifier() and ParseRestEnd(): move advancement of ptr to remove
a confusing calculation.
VarParseLong(): cleanup calculation of consumed.
Patch: 7.114
Submitted by: Max Okumoto <okumoto@ucsd.edu>
actual variable lookup. Consistently rename lengthPtr to consumed.
Update a number of comments to match the code.
Patch: 7.111-113
Submitted by: Max Okumoto <okumoto@ucsd.edu>
that is now used for both the 'M'/'N' branch and the 'S' branch of
the switch statement into a common scope.
Patch: 7.102-105
Submitted by: Max Okumoto <okumoto@ucsd.edu>
paranthesis or brace) into the loop and don't leak the buffer in this
case. Remove the check for Var_Parse returning NULL - it can't.
Patch: 7.92
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Return always malloc()-ed strings from VarParseShort() to get
rid of warnings when returning string constants from a non-const char *
function.
Patch: 7.90
Submitted by: Max Okumoto <okumoto@ucsd.edu>
to VarExpand down into the branches of the if as well as cleanup code.
Eliminate code that is now obviously dead.
Patch: 7.83
Submitted by: Max Okumoto <okumoto@ucsd.edu>
an else clause. Move the assignment to the lengthPtr down to
just before the return statements.
Patch: 7.81
Submitted by: Max Okumoto <okumoto@ucsd.edu>
functions: one for the single letter variables, one for the others
and one that does the recursive expansion.
Patches: 7.68-7.79
Submitted by: Max Okumoto <okumoto@ucsd.edu>
after a return. Move assignments to {freePtr, dynamic, start} closer to the
return statements to clarify which variables are actually used for
communication between the losely coupled blocks of the code. Clear up
an if-expression to make common structures of the conditions clearer.
Use strchr instead of switch statements to check for a character beeing
a member of a set.
Patches: 7-62.2, 7-62.3, 7-64, 7-65.1, 7-65.2
Submitted by: Max Okumoto <okumoto@ucsd.edu>