← easystroke

Replace canonicalize_file_name by realpath

6add3f6e461ab3ae8cc70c651527506d88fc8fc0 · Thomas Jaeger · Feb 19, 2013 00:56

canonicalize_file_name is not portable.

Fixes https://sourceforge.net/apps/trac/easystroke/ticket/118

+1 −1 · 1 file changed

  • main.cc +1 −1
diff --git a/main.cc b/main.cc
index 3fb1d78..a03e5ab 100644
--- a/main.cc
+++ b/main.cc
@@ -1350,7 +1350,7 @@ void Main::create_config_dir() {
 		config_dir += "/.easystroke";
 	}
 	struct stat st;
-	char *name = canonicalize_file_name(config_dir.c_str());
+	char *name = realpath(config_dir.c_str(), NULL);
 
 	// check if the directory does not exist
 	if (lstat(name, &st) == -1) {