diff options
author | Mikhail Efremov <sem@altlinux.org> | 2017-04-12 19:32:34 +0300 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-04-14 23:41:00 +0200 |
commit | 07da0340043b3b4d3ffc005e0a10b4776157a0fe (patch) | |
tree | 8e1f12868d71c1a9d9857eef6de979cfa2aa1704 /src | |
parent | e35eb212d12c18e111b2ff9eb7580cc96e24f4dc (diff) | |
download | external_libqmi-07da0340043b3b4d3ffc005e0a10b4776157a0fe.zip external_libqmi-07da0340043b3b4d3ffc005e0a10b4776157a0fe.tar.gz external_libqmi-07da0340043b3b4d3ffc005e0a10b4776157a0fe.tar.bz2 |
utils: drop useless g_file_test() call
canonicalize_file_name() returns NULL if file doesn't exist,
so no need to check file existence with g_file_test().
Diffstat (limited to 'src')
-rw-r--r-- | src/libqmi-glib/qmi-utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libqmi-glib/qmi-utils.c b/src/libqmi-glib/qmi-utils.c index 29e5f22..5d399a6 100644 --- a/src/libqmi-glib/qmi-utils.c +++ b/src/libqmi-glib/qmi-utils.c @@ -743,8 +743,10 @@ __qmi_utils_get_driver (const gchar *cdc_wdm_path) path = canonicalize_file_name (tmp); g_free (tmp); - if (g_file_test (path, G_FILE_TEST_EXISTS)) - driver = g_path_get_basename (path); + if (!path) + continue; + + driver = g_path_get_basename (path); g_free (path); } |