[vlc-devel] [PATCH] WinCE: remove call to unsupported getcwd()
Pierre Ynard
linkfanel at yahoo.fr
Mon May 18 11:39:14 CEST 2009
WinCE doesn't support working directories at all, so don't even try...
Compile-tested only
diff --git a/src/text/strings.c b/src/text/strings.c
index 9c6d931..6a32a31 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -1173,10 +1173,17 @@ char *make_URI (const char *path)
#endif
if (path[0] != DIR_SEP_CHAR)
{ /* Relative path: prepend the current working directory */
+#ifdef UNDER_CE
+ /* WinCE lacks any notion of working directory, so you're not
+ * supposed to use a relative path. We take a guess as a best
+ * effort. */
+ const char *cwd = "\\My Documents";
+#else
char cwd[PATH_MAX];
if (getcwd (cwd, sizeof (cwd)) == NULL) /* FIXME: UTF8? */
return NULL;
+#endif
if (asprintf (&buf, "%s/%s", cwd, path) == -1)
return NULL;
char *ret = make_URI (buf);
Regards,
--
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."
More information about the vlc-devel
mailing list