changeset 701:28af4b6dd9ef

Use G_DIR_SEPARATOR instead of '/' where applicable.
author zas_
date Tue, 20 May 2008 22:00:14 +0000
parents b2eb4ff74d13
children e07895754e65
files src/ui_fileops.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui_fileops.c	Tue May 20 21:51:25 2008 +0000
+++ b/src/ui_fileops.c	Tue May 20 22:00:14 2008 +0000
@@ -596,7 +596,7 @@
 
 	if (!path) return NULL;
 
-	base = strrchr(path, '/');
+	base = strrchr(path, G_DIR_SEPARATOR);
 	if (base) return base + 1;
 
 	return path;
@@ -610,7 +610,7 @@
 
 	while (path[p])
 		{
-		if (path[p] == '/') n = p;
+		if (path[p] == G_DIR_SEPARATOR) n = p;
 		p++;
 		}
 	if (n <= 0) n++;
@@ -674,15 +674,15 @@
 
 	while (path[s] != '\0')
 		{
-		if (path[s] == '/' && path[s+1] == '.' && (path[s+2] == '/' || path[s+2] == '\0') )
+		if (path[s] == G_DIR_SEPARATOR && path[s+1] == '.' && (path[s+2] == G_DIR_SEPARATOR || path[s+2] == '\0') )
 			{
 			s += 2;
 			}
-		else if (path[s] == '/' && path[s+1] == '.' && path[s+2] == '.' && (path[s+3] == '/' || path[s+3] == '\0') )
+		else if (path[s] == G_DIR_SEPARATOR && path[s+1] == '.' && path[s+2] == '.' && (path[s+3] == G_DIR_SEPARATOR || path[s+3] == '\0') )
 			{
 			s += 3;
 			if (t > 0) t--;
-			while (path[t] != '/' && t > 0) t--;
+			while (path[t] != G_DIR_SEPARATOR && t > 0) t--;
 			}
 		else
 			{
@@ -691,8 +691,8 @@
 			s++;
 			}
 		}
-	if (t == 0 && path[t] == '/') t++;
-	if (t > 1 && path[t-1] == '/') t--;
+	if (t == 0 && path[t] == G_DIR_SEPARATOR) t++;
+	if (t > 1 && path[t-1] == G_DIR_SEPARATOR) t--;
 	path[t] = '\0';
 }