path: cosmetics

Avoiding conditional directives that split up parts of statements.

Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
lzmths 2015-12-01 20:58:01 -03:00 committed by wm4
parent b325ed1105
commit 69cc002c92
1 changed files with 5 additions and 3 deletions

View File

@ -226,17 +226,19 @@ char *mp_splitext(const char *path, bstr *root)
char *mp_path_join_bstr(void *talloc_ctx, struct bstr p1, struct bstr p2)
{
bool test;
if (p1.len == 0)
return bstrdup0(talloc_ctx, p2);
if (p2.len == 0)
return bstrdup0(talloc_ctx, p1);
#if HAVE_DOS_PATHS
if ((p2.len >= 2 && p2.start[1] == ':')
|| p2.start[0] == '\\' || p2.start[0] == '/')
test = (p2.len >= 2 && p2.start[1] == ':')
|| p2.start[0] == '\\' || p2.start[0] == '/';
#else
if (p2.start[0] == '/')
test = p2.start[0] == '/';
#endif
if (test)
return bstrdup0(talloc_ctx, p2); // absolute path
bool have_separator;