diff options
Diffstat (limited to 'src/util/strings.c')
-rw-r--r-- | src/util/strings.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/util/strings.c b/src/util/strings.c index dc46ad33a..25b09f8e2 100644 --- a/src/util/strings.c +++ b/src/util/strings.c | |||
@@ -602,20 +602,13 @@ char * | |||
602 | GNUNET_STRINGS_filename_expand(const char *fil) | 602 | GNUNET_STRINGS_filename_expand(const char *fil) |
603 | { | 603 | { |
604 | char *buffer; | 604 | char *buffer; |
605 | |||
606 | #ifndef MINGW | ||
607 | size_t len; | 605 | size_t len; |
608 | char *fm; | 606 | char *fm; |
609 | const char *fil_ptr; | 607 | const char *fil_ptr; |
610 | #else | ||
611 | char *fn; | ||
612 | long lRet; | ||
613 | #endif | ||
614 | 608 | ||
615 | if (fil == NULL) | 609 | if (fil == NULL) |
616 | return NULL; | 610 | return NULL; |
617 | 611 | ||
618 | #ifndef MINGW | ||
619 | if (fil[0] == DIR_SEPARATOR) | 612 | if (fil[0] == DIR_SEPARATOR) |
620 | /* absolute path, just copy */ | 613 | /* absolute path, just copy */ |
621 | return GNUNET_strdup(fil); | 614 | return GNUNET_strdup(fil); |
@@ -677,34 +670,6 @@ GNUNET_STRINGS_filename_expand(const char *fil) | |||
677 | fil_ptr); | 670 | fil_ptr); |
678 | GNUNET_free(fm); | 671 | GNUNET_free(fm); |
679 | return buffer; | 672 | return buffer; |
680 | #else | ||
681 | fn = GNUNET_malloc(MAX_PATH + 1); | ||
682 | |||
683 | if ((lRet = plibc_conv_to_win_path(fil, fn)) != ERROR_SUCCESS) | ||
684 | { | ||
685 | SetErrnoFromWinError(lRet); | ||
686 | LOG_STRERROR(GNUNET_ERROR_TYPE_WARNING, "plibc_conv_to_win_path"); | ||
687 | return NULL; | ||
688 | } | ||
689 | /* is the path relative? */ | ||
690 | if ((0 != strncmp(fn + 1, ":\\", 2)) && (0 != strncmp(fn, "\\\\", 2))) | ||
691 | { | ||
692 | char szCurDir[MAX_PATH + 1]; | ||
693 | |||
694 | lRet = GetCurrentDirectory(MAX_PATH + 1, szCurDir); | ||
695 | if (lRet + strlen(fn) + 1 > (MAX_PATH + 1)) | ||
696 | { | ||
697 | SetErrnoFromWinError(ERROR_BUFFER_OVERFLOW); | ||
698 | LOG_STRERROR(GNUNET_ERROR_TYPE_WARNING, "GetCurrentDirectory"); | ||
699 | return NULL; | ||
700 | } | ||
701 | GNUNET_asprintf(&buffer, "%s\\%s", szCurDir, fn); | ||
702 | GNUNET_free(fn); | ||
703 | fn = buffer; | ||
704 | } | ||
705 | |||
706 | return fn; | ||
707 | #endif | ||
708 | } | 673 | } |
709 | 674 | ||
710 | 675 | ||