From 69cc002c9294a2982dc3753a9602c10d34c1020b Mon Sep 17 00:00:00 2001 From: lzmths Date: Tue, 1 Dec 2015 20:58:01 -0300 Subject: path: cosmetics Avoiding conditional directives that split up parts of statements. Signed-off-by: wm4 --- options/path.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'options/path.c') diff --git a/options/path.c b/options/path.c index c5c374690a..5072e7312c 100644 --- a/options/path.c +++ b/options/path.c @@ -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; -- cgit v1.2.3