aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar lzmths <luizmatheus.ac@gmail.com>2015-12-01 20:58:01 -0300
committerGravatar wm4 <wm4@nowhere>2015-12-02 12:31:48 +0100
commit69cc002c9294a2982dc3753a9602c10d34c1020b (patch)
tree13d89109fa0c14ce43fd936afcaa2eed4748e84d
parentb325ed11055e67a3c8842a56380830e5fdf8bf2c (diff)
path: cosmetics
Avoiding conditional directives that split up parts of statements. Signed-off-by: wm4 <wm4@nowhere>
-rw-r--r--options/path.c8
1 files changed, 5 insertions, 3 deletions
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;