소스 검색

fix bug in GetPrevDirectoryPath on Unix-like systems (#1246)

pull/1251/head
ivn 5 년 전
committed by GitHub
부모
커밋
730375faf7
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. +3
    -2
      src/core.c

+ 3
- 2
src/core.c 파일 보기

@ -2087,11 +2087,12 @@ const char *GetPrevDirectoryPath(const char *dirPath)
if (pathLen <= 3) strcpy(prevDirPath, dirPath);
for (int i = (pathLen - 1); (i > 0) && (pathLen > 3); i--)
for (int i = (pathLen - 1); (i >= 0) && (pathLen > 3); i--)
{
if ((dirPath[i] == '\\') || (dirPath[i] == '/'))
{
if (i == 2) i++; // Check for root: "C:\"
if ((i == 2) && (dirPath[1] ==':') // Check for root: "C:\"
|| i == 0) i++; // Check for root: "/"
strncpy(prevDirPath, dirPath, i);
break;
}

불러오는 중...
취소
저장