From 5488581d183cf245a9ffdeb30732f155d9db8b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Sat, 23 Jul 2016 02:28:51 +0100 Subject: Replace an #ifdef with g_path_is_absolute() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0df8ea363502bb5e313192b6a10f6df032031699 Reviewed-on: https://code.wireshark.org/review/16601 Petri-Dish: João Valverde Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris Reviewed-by: Pascal Quantin --- ui/help_url.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'ui/help_url.c') diff --git a/ui/help_url.c b/ui/help_url.c index 0a10666afc..5ea67ba53f 100644 --- a/ui/help_url.c +++ b/ui/help_url.c @@ -47,13 +47,8 @@ data_file_url(const gchar *filename) gchar *uri; /* Absolute path? */ -#ifdef G_OS_WIN32 - if((strlen(filename) > 2) && (filename[1] == ':')) { - file_path = g_strdup(filename); -#else - if((strlen(filename) > 1) && (filename[0] == '/')) { - file_path = g_strdup(filename); -#endif + if(g_path_is_absolute(filename)) { + file_path = g_strdup(filename); } else if(running_in_build_directory()) { file_path = g_strdup_printf("%s/doc/%s", get_datafile_dir(), filename); } else { -- cgit v1.2.1