Fossil SCM
Fix compilation issues cause by the trunk merge.
Commit
12453740c7089157342a232ef17ebb8652b921b3
Parent
abd131b83c2a37c…
2 files changed
+5
-3
+12
-7
+5
-3
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -785,13 +785,15 @@ | ||
| 785 | 785 | db_prepare(&move, "SELECT x, y FROM fmove ORDER BY x;"); |
| 786 | 786 | while( db_step(&move)==SQLITE_ROW ){ |
| 787 | 787 | const char *zOldName = db_column_text(&move, 0); |
| 788 | 788 | const char *zNewName = db_column_text(&move, 1); |
| 789 | 789 | if( !dryRunFlag ){ |
| 790 | - if( file_isdir(zOldName)==1 ){ | |
| 791 | - if( file_isdir(zNewName)==0 ){ | |
| 792 | - file_rename(zOldName, zNewName); | |
| 790 | + int isOldDir = file_isdir(zOldName); | |
| 791 | + if( isOldDir==1 ){ | |
| 792 | + int isNewDir = file_isdir(zNewName); | |
| 793 | + if( isNewDir==0 ){ | |
| 794 | + file_rename(zOldName, zNewName, isOldDir, isNewDir); | |
| 793 | 795 | } |
| 794 | 796 | }else{ |
| 795 | 797 | if( file_wd_islink(zOldName) ){ |
| 796 | 798 | symlink_copy(zOldName, zNewName); |
| 797 | 799 | }else{ |
| 798 | 800 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -785,13 +785,15 @@ | |
| 785 | db_prepare(&move, "SELECT x, y FROM fmove ORDER BY x;"); |
| 786 | while( db_step(&move)==SQLITE_ROW ){ |
| 787 | const char *zOldName = db_column_text(&move, 0); |
| 788 | const char *zNewName = db_column_text(&move, 1); |
| 789 | if( !dryRunFlag ){ |
| 790 | if( file_isdir(zOldName)==1 ){ |
| 791 | if( file_isdir(zNewName)==0 ){ |
| 792 | file_rename(zOldName, zNewName); |
| 793 | } |
| 794 | }else{ |
| 795 | if( file_wd_islink(zOldName) ){ |
| 796 | symlink_copy(zOldName, zNewName); |
| 797 | }else{ |
| 798 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -785,13 +785,15 @@ | |
| 785 | db_prepare(&move, "SELECT x, y FROM fmove ORDER BY x;"); |
| 786 | while( db_step(&move)==SQLITE_ROW ){ |
| 787 | const char *zOldName = db_column_text(&move, 0); |
| 788 | const char *zNewName = db_column_text(&move, 1); |
| 789 | if( !dryRunFlag ){ |
| 790 | int isOldDir = file_isdir(zOldName); |
| 791 | if( isOldDir==1 ){ |
| 792 | int isNewDir = file_isdir(zNewName); |
| 793 | if( isNewDir==0 ){ |
| 794 | file_rename(zOldName, zNewName, isOldDir, isNewDir); |
| 795 | } |
| 796 | }else{ |
| 797 | if( file_wd_islink(zOldName) ){ |
| 798 | symlink_copy(zOldName, zNewName); |
| 799 | }else{ |
| 800 |
+12
-7
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -404,23 +404,28 @@ | ||
| 404 | 404 | |
| 405 | 405 | /* |
| 406 | 406 | ** Rename a file or directory. |
| 407 | 407 | ** Returns zero upon success. |
| 408 | 408 | */ |
| 409 | -int file_rename(const char *zFrom, const char *zTo){ | |
| 409 | +int file_rename( | |
| 410 | + const char *zFrom, | |
| 411 | + const char *zTo, | |
| 412 | + int isFromDir, | |
| 413 | + int isToDir | |
| 414 | +){ | |
| 410 | 415 | int rc; |
| 411 | 416 | #if defined(_WIN32) |
| 412 | - wchar_t *zMbcsFrom = fossil_utf8_to_filename(zFrom); | |
| 413 | - wchar_t *zMbcsTo = fossil_utf8_to_filename(zTo); | |
| 417 | + wchar_t *zMbcsFrom = fossil_utf8_to_path(zFrom, isFromDir); | |
| 418 | + wchar_t *zMbcsTo = fossil_utf8_to_path(zTo, isToDir); | |
| 414 | 419 | rc = _wrename(zMbcsFrom, zMbcsTo); |
| 415 | 420 | #else |
| 416 | - char *zMbcsFrom = fossil_utf8_to_filename(zFrom); | |
| 417 | - char *zMbcsTo = fossil_utf8_to_filename(zTo); | |
| 421 | + char *zMbcsFrom = fossil_utf8_to_path(zFrom, isFromDir); | |
| 422 | + char *zMbcsTo = fossil_utf8_to_path(zTo, isToDir); | |
| 418 | 423 | rc = rename(zMbcsFrom, zMbcsTo); |
| 419 | 424 | #endif |
| 420 | - fossil_filename_free(zMbcsTo); | |
| 421 | - fossil_filename_free(zMbcsFrom); | |
| 425 | + fossil_path_free(zMbcsTo); | |
| 426 | + fossil_path_free(zMbcsFrom); | |
| 422 | 427 | return rc; |
| 423 | 428 | } |
| 424 | 429 | |
| 425 | 430 | /* |
| 426 | 431 | ** Copy the content of a file from one place to another. |
| 427 | 432 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -404,23 +404,28 @@ | |
| 404 | |
| 405 | /* |
| 406 | ** Rename a file or directory. |
| 407 | ** Returns zero upon success. |
| 408 | */ |
| 409 | int file_rename(const char *zFrom, const char *zTo){ |
| 410 | int rc; |
| 411 | #if defined(_WIN32) |
| 412 | wchar_t *zMbcsFrom = fossil_utf8_to_filename(zFrom); |
| 413 | wchar_t *zMbcsTo = fossil_utf8_to_filename(zTo); |
| 414 | rc = _wrename(zMbcsFrom, zMbcsTo); |
| 415 | #else |
| 416 | char *zMbcsFrom = fossil_utf8_to_filename(zFrom); |
| 417 | char *zMbcsTo = fossil_utf8_to_filename(zTo); |
| 418 | rc = rename(zMbcsFrom, zMbcsTo); |
| 419 | #endif |
| 420 | fossil_filename_free(zMbcsTo); |
| 421 | fossil_filename_free(zMbcsFrom); |
| 422 | return rc; |
| 423 | } |
| 424 | |
| 425 | /* |
| 426 | ** Copy the content of a file from one place to another. |
| 427 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -404,23 +404,28 @@ | |
| 404 | |
| 405 | /* |
| 406 | ** Rename a file or directory. |
| 407 | ** Returns zero upon success. |
| 408 | */ |
| 409 | int file_rename( |
| 410 | const char *zFrom, |
| 411 | const char *zTo, |
| 412 | int isFromDir, |
| 413 | int isToDir |
| 414 | ){ |
| 415 | int rc; |
| 416 | #if defined(_WIN32) |
| 417 | wchar_t *zMbcsFrom = fossil_utf8_to_path(zFrom, isFromDir); |
| 418 | wchar_t *zMbcsTo = fossil_utf8_to_path(zTo, isToDir); |
| 419 | rc = _wrename(zMbcsFrom, zMbcsTo); |
| 420 | #else |
| 421 | char *zMbcsFrom = fossil_utf8_to_path(zFrom, isFromDir); |
| 422 | char *zMbcsTo = fossil_utf8_to_path(zTo, isToDir); |
| 423 | rc = rename(zMbcsFrom, zMbcsTo); |
| 424 | #endif |
| 425 | fossil_path_free(zMbcsTo); |
| 426 | fossil_path_free(zMbcsFrom); |
| 427 | return rc; |
| 428 | } |
| 429 | |
| 430 | /* |
| 431 | ** Copy the content of a file from one place to another. |
| 432 |