comparison src/os_mswin.c @ 23:3f44e9abe4ec v7.0015

updated for version 7.0015
author vimboss
date Mon, 06 Sep 2004 17:44:46 +0000
parents db5102f7e29f
children 404aac550f35
comparison
equal deleted inserted replaced
22:cc049b00ee70 23:3f44e9abe4ec
441 STRNCPY(buf, name, _MAX_PATH); 441 STRNCPY(buf, name, _MAX_PATH);
442 buf[_MAX_PATH] = NUL; 442 buf[_MAX_PATH] = NUL;
443 p = buf + strlen(buf); 443 p = buf + strlen(buf);
444 if (p > buf) 444 if (p > buf)
445 --p; 445 --p;
446 #ifdef FEAT_MBYTE
447 if (p > buf && has_mbyte)
448 p -= (*mb_head_off)(buf, p);
449 #endif
446 if (p > buf && (*p == '\\' || *p == '/') && p[-1] != ':') 450 if (p > buf && (*p == '\\' || *p == '/') && p[-1] != ':')
447 *p = NUL; 451 *p = NUL;
448 #ifdef FEAT_MBYTE 452 #ifdef FEAT_MBYTE
449 if (enc_codepage >= 0 && (int)GetACP() != enc_codepage 453 if (enc_codepage >= 0 && (int)GetACP() != enc_codepage
450 # ifdef __BORLANDC__ 454 # ifdef __BORLANDC__
621 path += 2; 625 path += 2;
622 } 626 }
623 627
624 if (*path == NUL) /* drive name only */ 628 if (*path == NUL) /* drive name only */
625 return 0; 629 return 0;
630
631 #ifdef FEAT_MBYTE
632 if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
633 {
634 WCHAR *p = enc_to_ucs2(path, NULL);
635 int n;
636
637 if (p != NULL)
638 {
639 n = _wchdir(p);
640 vim_free(p);
641 if (n == 0)
642 return 0;
643 /* Retry with non-wide function (for Windows 98). */
644 }
645 }
646 #endif
626 647
627 return chdir(path); /* let the normal chdir() do the rest */ 648 return chdir(path); /* let the normal chdir() do the rest */
628 } 649 }
629 650
630 651