ref: 94b1d3f0ad587b6e507ff872eb8562466e3af21a
parent: 6b0150764cc579c3764e6ed2a6db1237f11577de
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Dec 28 13:10:41 EST 2023
mk: Various improvements Variables are lists, just as in rc, so preserve emptry strings ('') in variables properly: FOO='' bar baz should result in FOO=('' bar baz) in the environment, while FOO= becomes a emptry list FOO=(). Get rid of the Evy struct, the environment can be represented as just an array of Symtab pointers, also meaning the value can never be out of sync. Embedd the name string in Symtab struct. It is immutable and dont require the caller to strdup() the name. Make Word's immutable, embedding the string value in the Word struct. This avoids alot of extra allocations. Provide a Strdup() function that handles allocation error. Handle variable overrides from the command line internally, avoiding the maketmp() file. When executing a recipe, pass the body using the -c flag to rc, avoiding a pipe() and fork(). This also has the advntage that rc can optimize the script as it sees it in its entirety and avoid fork() down the line. Make sure not to leak file-descriptors into sub-processes. Do an attempt at freeing memory (mostly for Arc's and environment values).