mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix tix-build honoring empty triplet variables.
This commit is contained in:
parent
b2addd979c
commit
dd26ee724a
2 changed files with 9 additions and 2 deletions
|
@ -868,9 +868,9 @@ int main(int argc, char* argv[])
|
|||
|
||||
if ( !minfo.build && !(minfo.build = GetBuildTriplet()) )
|
||||
error(1, errno, "unable to determine build, use --build or BUILD");
|
||||
if ( !minfo.host && !(minfo.host = strdup_null(getenv("HOST"))) )
|
||||
if ( !minfo.host && !(minfo.host = strdup_null_if_content(getenv("HOST"))) )
|
||||
minfo.host = strdup(minfo.build);
|
||||
if ( !minfo.target && !(minfo.target = strdup_null(getenv("TARGET"))) )
|
||||
if ( !minfo.target && !(minfo.target = strdup_null_if_content(getenv("TARGET"))) )
|
||||
minfo.target = strdup(minfo.host);
|
||||
|
||||
if ( minfo.prefix && !minfo.exec_prefix )
|
||||
|
|
|
@ -75,6 +75,13 @@ char* strdup_null(const char* src)
|
|||
return src ? strdup(src) : NULL;
|
||||
}
|
||||
|
||||
char* strdup_null_if_content(const char* src)
|
||||
{
|
||||
if ( src && !src[0] )
|
||||
return NULL;
|
||||
return strdup_null(src);
|
||||
}
|
||||
|
||||
const char* non_modify_basename(const char* path)
|
||||
{
|
||||
const char* last_slash = (char*) strrchr((char*) path, '/');
|
||||
|
|
Loading…
Add table
Reference in a new issue