summaryrefslogtreecommitdiffstatshomepage
path: root/unix
diff options
context:
space:
mode:
authorstijn <stinos@zoho.com>2014-05-03 10:26:04 +0200
committerstijn <stinos@zoho.com>2014-05-03 17:38:08 +0200
commit4cd21deebca0e75b77d62d8d748aa66453532d9b (patch)
tree0fdf136db5371bb6c69ec27c1ecddcc5c270f50c /unix
parentbff1ff28eec5611a2e963601b98044135694df57 (diff)
downloadmicropython-4cd21deebca0e75b77d62d8d748aa66453532d9b.tar.gz
micropython-4cd21deebca0e75b77d62d8d748aa66453532d9b.zip
mingw: Add implementation of realpath()
The mingw port used _fullpath() until now, but the behaviour is not exactly the same as realpath()'s on unix; major difference being that it doesn't return an error for non-existing files, which would bypass main's error checking and bail out without any error message. Also realpath() will return forward slashes only since main() relies on that.
Diffstat (limited to 'unix')
-rw-r--r--unix/main.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/unix/main.c b/unix/main.c
index e677ff65d0..c001bc8109 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -394,11 +394,7 @@ int main(int argc, char **argv) {
return usage(argv);
}
} else {
-#ifdef __MINGW32__
- char *basedir = _fullpath(NULL, argv[a], _MAX_PATH);
-#else
char *basedir = realpath(argv[a], NULL);
-#endif
if (basedir == NULL) {
fprintf(stderr, "%s: can't open file '%s': [Errno %d] ", argv[0], argv[1], errno);
perror("");