| | @@ -658,30 +658,31 @@ |
| 658 | 658 | while( db_step(&q)==SQLITE_ROW ){ |
| 659 | 659 | const char *zName = db_column_text(&q, 0); |
| 660 | 660 | const char *zUuid = db_column_text(&q, 1); |
| 661 | 661 | const char *zOrig = db_column_text(&q, 2); |
| 662 | 662 | int frid = db_column_int(&q, 3); |
| 663 | | - int isexe = db_column_int(&q, 4); |
| 663 | + int isExe = db_column_int(&q, 4); |
| 664 | 664 | int isLink = db_column_int(&q, 5); |
| 665 | 665 | int isSelected = db_column_int(&q, 6); |
| 666 | 666 | const char *zPerm; |
| 667 | 667 | int cmp; |
| 668 | 668 | #if !defined(_WIN32) |
| 669 | | - /* For unix, extract the "executable" permission bit directly from |
| 670 | | - ** the filesystem. On windows, the "executable" bit is retained |
| 669 | + int mPerm; |
| 670 | + |
| 671 | + /* For unix, extract the "executable" and "symlink" permissions |
| 672 | + ** directly from the filesystem. On windows, permissions are |
| 671 | 673 | ** unchanged from the original. |
| 672 | 674 | */ |
| 675 | + |
| 673 | 676 | blob_resize(&filename, nBasename); |
| 674 | 677 | blob_append(&filename, zName, -1); |
| 675 | | - isexe = file_wd_isexe(blob_str(&filename)); |
| 676 | | - |
| 677 | | - /* For unix, check if the file on the filesystem is symlink. |
| 678 | | - ** On windows, the bit is retained unchanged from original. |
| 679 | | - */ |
| 680 | | - isLink = file_wd_islink(blob_str(&filename)); |
| 678 | + |
| 679 | + mPerm = file_wd_perm(blob_str(&filename)); |
| 680 | + isExe = ( mPerm==PERM_EXE ); |
| 681 | + isLink = ( mPerm==PERM_LNK ); |
| 681 | 682 | #endif |
| 682 | | - if( isexe ){ |
| 683 | + if( isExe ){ |
| 683 | 684 | zPerm = " x"; |
| 684 | 685 | }else if( isLink ){ |
| 685 | 686 | zPerm = " l"; /* note: symlinks don't have executable bit on unix */ |
| 686 | 687 | }else{ |
| 687 | 688 | zPerm = ""; |
| 688 | 689 | |