| Age | Commit message (Collapse) | Author |
|
This reduces the number of variable declarations at the call sites.
|
|
Previously, the error message was "Unknown directive", which was
obviously wrong. The new error message is "Missing argument".
|
|
|
|
|
|
|
|
|
|
ParseGetLine always returns a logical line, even for PARSE_RAW.
|
|
The address of readMoreArg is hardly useful when stepping through this
part of the code, therefore omit it. Instead of mentioning the exact
function names of the data source, describe them in words, which helps
especially in the case of .for loops.
|
|
|
|
|
|
|
|
|
|
|
|
The previous variable names had been chosen at a time when compilers
didn't merge variables into the same registers. Luckily, these times
are gone, and it's no longer necessary to use a variable for 2 or more
completely unrelated purposes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In function names, the word "get" was not used consistently to look up
or compute data, in several cases "get" was a synonym for "read", just
like in the standard C library (fgetc).
The really confusing part is that there are two functions now, called
ParseGetLine and ParseReadLine, and both were underdocumented.
|
|
This is needed to compile bmake with GCC 2.8.1 on SunOS 5.9.
To support ancient systems like this, the whole code of usr.bin/make is
supposed to use only ISO C90 features, except for filemon, which is not
used on these systems.
|
|
The function basename from POSIX has a few unfortunate properties, it is
allowed to return a pointer to static memory. This is too unreliable,
therefore this trivial own implementation.
|
|
Now that the parsing of the directives is unified and strict, there is
no need anymore for the dispatched functions to check for unknown
directives. These functions don't even get the information to decide
that since this decision is already done.
|
|
Since a line is not an iterator and since the expression *line typically
means "the current element", not "the first character", replacing *line
with line[0] more directly expresses the idea of accessing the first
character of a string.
|
|
|
|
|
|
Before, make accepted misspellings like .warnings, .export-literally and
a few others, all of which are unlikely to occur in practice. See the
test directive-misspellings.mk for further details.
|
|
|
|
|
|
Makefiles are text files, they must not contain null bytes.
The previous code in this area was rotten anyway. It assumed that
buf_end could be NULL even if buf_ptr was a valid pointer, which is no
longer true, probably since a few years already.
Continuing parsing after a null byte does not make sense. If there's a
null byte in a text file, that file is corrupted, and parsing it leads
to unintended effects easily. Therefore the only sensible action is to
stop parsing immediately.
The check whether cf->readMore could be null was outdated as well, which
previously made the fatal error impossible to reach. Because of the
missing unit tests, nobody noticed this though.
The "exit status 0" in opt-file.exp is worring but that's due to another
bug and will be fixed in a follow-up commit.
|
|
The previous name sounded too much like a noun, which was too confusing.
See unit-tests/opt-file.mk for the history of this part of the code.
|
|
Adding a number to a null pointer should have been caught by any
Undefined Behavior Sanitizer, but apparently neither GCC nor Clang do
this.
|
|
|
|
|
|
|
|
|
|
|
|
The word "Do" was not necessary.
|
|
|
|
|
|
This change moves the initialization and finalization of the list of
targets to the same function. They had been split before.
|
|
|
|
The function Dir_Destroy is an implementation detail of the cached
directories, and it should not be exported to the other modules. The
search paths, on the other hand, are the high-level API that may be used
by the other modules, as the concept of search paths is documented in
the manual page.
|
|
These functions have the search path as their main subject.
|
|
|
|
|
|
|