Replace G_DIR_SEPARATOR by / this is easier to read.
authorDaniel Carl <danielcarl@gmx.de>
Wed, 12 Mar 2014 19:44:05 +0000 (20:44 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Wed, 12 Mar 2014 19:44:05 +0000 (20:44 +0100)
src/setting.c
src/util.c

index c76325e..1586678 100644 (file)
@@ -672,8 +672,8 @@ static SettingStatus download_path(const Setting *s, const SettingType type)
             vb.config.download_dir = NULL;
         }
         path = util_expand(s->arg.s);
-        /* if path is not absolute create it in the home directory */
-        if (*path != G_DIR_SEPARATOR) {
+        /* if path is not absolute set it in the home directory */
+        if (*path != '/') {
             vb.config.download_dir = g_build_filename(util_get_home_dir(), path, NULL);
             g_free(path);
         } else {
index 38212d6..63f0654 100644 (file)
@@ -303,7 +303,7 @@ char *util_build_path(const char *path, const char *dir)
 
     /* if the path could be expanded */
     if ((fexp = util_expand(path))) {
-        if (*fexp == G_DIR_SEPARATOR) {
+        if (*fexp == '/') {
             /* path is already absolute, no need to use given dir - there is
              * no need to free fexp, bacuse this should be done by the caller
              * on fullPath later */
@@ -324,7 +324,7 @@ char *util_build_path(const char *path, const char *dir)
         fullPath = g_build_filename(g_get_current_dir(), path, NULL);
     }
 
-    if ((p = strrchr(fullPath, G_DIR_SEPARATOR))) {
+    if ((p = strrchr(fullPath, '/'))) {
         *p = '\0';
         util_create_dir_if_not_exists(fullPath);
         *p = '/';
@@ -353,12 +353,12 @@ char *util_expand(const char *src)
         if (*src == '~' && start) {
             /* skip the ~ */
             src++;
-            if (*src == G_DIR_SEPARATOR) {
+            if (*src == '/') {
                 g_string_append(dst, util_get_home_dir());
             } else {
                 name = g_string_new("");
                 /* look ahead to / space or end of string */
-                while (*src && *src != G_DIR_SEPARATOR && !VB_IS_SPACE(*src)) {
+                while (*src && *src != '/' && !VB_IS_SPACE(*src)) {
                     g_string_append_c(name, *src);
                     src++;
                 }