This return value is not supposed to be modified since it can be a string
literal. The modifiable part is returned via freePtr, but only for
freeing, not for actually modifying anything.
This prevents partial builds after changing a header. The declared
dependencies are more than strictly necessary, but that's still better
than having inconsistent partial builds because too few dependencies are
declared.
The dependencies between the C files and nonints.h are not declared
properly, which resulted in a successful partial build, but a full "make
clean && make" failed.
Var_Parse can return either a string literal or an allocated string. The
former must not be modified by the caller. If the string is allocated,
it is returned in freePtr as well, but only for freeing it after use.
Reusing a const char * parameter to store a char * and later free that
string was not a good idea. It made the pretty long code of Var_Parse
more difficult to understand.
The flag VARE_NOSUBST is only a few days old. It had grown out of the
VARP_NOSUBST and VAR_NOSUBST flags, not knowing at that time that it
meant the exact opposite of VARE_WANTRES.
The comparison against ac - 1 could have been optimized by the compilers
as well, but both GCC 5 and Clang produce smaller code for the comparison
against 0.
return that which poor behavior for the user, so return 0 instead.
We could document ~0 to be an error, but that would deviate from the
Linux behavior which is not desirable. Noted by Poul-Henning Kamp
Adding a string or a substring to a buffer are common tasks when handling
variables. There is no need to spell out the strlen call or the pointer
subtraction at every call site.
Subtracting pointers results in a ptrdiff_t, which would have to be
converted to an int in each case for WARNS=6. Having this conversion in a
single place keeps the code clean.
at https://github.com/xmm7360/xmm7360-pci
This version works on Linux, OpenBSD, and NetBSD.
OpenBSD port written for genua GmbH
Modem requires python script from the master site to initialize the network,
it will be added to pkgsrc shortly