Fossil SCM

Fix file_is_absolute_path(), accounting for "C:" being an absolute path

jan.nijtmans 2015-03-10 21:00 trunk
Commit 573bbd3eb94b7d3f64bea1edff4fc0b17839dda0
1 file changed +1 -1
+1 -1
--- src/file.c
+++ src/file.c
@@ -814,11 +814,11 @@
814814
int file_is_absolute_path(const char *zPath){
815815
if( zPath[0]=='/'
816816
#if defined(_WIN32) || defined(__CYGWIN__)
817817
|| zPath[0]=='\\'
818818
|| (fossil_isalpha(zPath[0]) && zPath[1]==':'
819
- && (zPath[2]=='\\' || zPath[2]=='/'))
819
+ && (zPath[2]=='\\' || zPath[2]=='/' || zPath[2]=='\0'))
820820
#endif
821821
){
822822
return 1;
823823
}else{
824824
return 0;
825825
--- src/file.c
+++ src/file.c
@@ -814,11 +814,11 @@
814 int file_is_absolute_path(const char *zPath){
815 if( zPath[0]=='/'
816 #if defined(_WIN32) || defined(__CYGWIN__)
817 || zPath[0]=='\\'
818 || (fossil_isalpha(zPath[0]) && zPath[1]==':'
819 && (zPath[2]=='\\' || zPath[2]=='/'))
820 #endif
821 ){
822 return 1;
823 }else{
824 return 0;
825
--- src/file.c
+++ src/file.c
@@ -814,11 +814,11 @@
814 int file_is_absolute_path(const char *zPath){
815 if( zPath[0]=='/'
816 #if defined(_WIN32) || defined(__CYGWIN__)
817 || zPath[0]=='\\'
818 || (fossil_isalpha(zPath[0]) && zPath[1]==':'
819 && (zPath[2]=='\\' || zPath[2]=='/' || zPath[2]=='\0'))
820 #endif
821 ){
822 return 1;
823 }else{
824 return 0;
825

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button