]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix issue in Windows code
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 20 Nov 2017 20:02:50 +0000 (15:02 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 20 Nov 2017 20:02:50 +0000 (15:02 -0500)
Sources/multimarkdown/main.c

index f30c2afbc032c25ce3c2844c22b9fe33552243ef..d0578bd05d9e2a9e18535e8694d21b925a85e5c7 100644 (file)
@@ -129,42 +129,6 @@ char * filename_with_extension(const char * original, const char * new_extension
 }
 
 
-// Windows does not know realpath(), so we need a "windows port"
-// Fix by @f8ttyc8t (<https://github.com/f8ttyc8t>)
-#if (defined(_WIN32) || defined(__WIN32__))
-// Let compiler know where to find GetFullPathName()
-#include <windows.h>
-
-char *realpath(const char *path, char *resolved_path) {
-       DWORD  retval = 0;
-       DWORD  dwBufSize = 0; // Just in case MAX_PATH differs from PATH_MAX
-       TCHAR  *buffer = NULL;
-
-       if (resolved_path == NULL) {
-               // realpath allocates appropiate bytes if resolved_path is null. This is to mimic realpath behavior
-               dwBufSize = PATH_MAX; // Use windows PATH_MAX constant, because we are in Windows context now.
-               buffer = (char*)malloc(dwBufSize);
-
-               if (buffer == NULL) {
-                       return NULL; // some really weird is going on...
-               }
-       } else {
-               dwBufSize = MAX_PATH;  // buffer has been allocated using MAX_PATH earlier
-               buffer = resolved_path;
-       }
-
-       retval = GetFullPathName(path, dwBufSize, buffer, NULL);
-
-       if (retval == 0) {
-               return NULL;
-               printf("Failed to GetFullPathName()\n");
-       }
-
-       return buffer;
-}
-#endif
-
-
 int main(int argc, char** argv) {
        int exitcode = EXIT_SUCCESS;
        char * binname = "multimarkdown";