Changeset 5064
- Timestamp:
- 12/03/07 19:07:45 (8 months ago)
- Files:
-
- wired/trunk/wired/files.c (modified) (6 diffs)
- wired/trunk/wired/files.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wired/trunk/wired/files.c
r5047 r5064 29 29 #include "config.h" 30 30 31 #ifdef HAVE_CORESERVICES_CORESERVICES_H 32 #import <CoreFoundation/CoreFoundation.h> 33 #endif 34 31 35 #include <sys/param.h> 32 36 #include <sys/stat.h> … … 631 635 /* get file type */ 632 636 type = wd_files_type_with_stat(filepath, &sb); 633 name = w i_string_with_cstring(p->fts_name);637 name = wd_files_path_with_decomposed_cstring(p->fts_name); 634 638 635 639 if(wi_string_contains_string(name, query, WI_STRING_CASE_INSENSITIVE)) { … … 874 878 WI_FTS *fts = NULL; 875 879 WI_FTSENT *p; 876 wi_string_t *filepath, *virtualpath, * string;880 wi_string_t *filepath, *virtualpath, *name, *string; 877 881 wi_number_t *number; 878 882 wi_file_offset_t size; … … 954 958 /* get file type & size */ 955 959 type = wd_files_type_with_stat(filepath, &sb); 960 name = wd_files_path_with_decomposed_cstring(p->fts_name); 956 961 957 962 switch(type) { … … 975 980 976 981 wi_file_write(file, WI_STR("%#s%c%#s%#@%c%u%c%llu%c%#@%c%#@\n"), 977 p->fts_name,WD_FIELD_SEPARATOR,982 name, WD_FIELD_SEPARATOR, 978 983 pathprefix, 979 984 virtualpath, WD_FIELD_SEPARATOR, … … 1320 1325 1321 1326 1327 wi_string_t * wd_files_path_with_decomposed_cstring(const char *cstring) { 1328 wi_string_t *path; 1329 1330 #ifdef HAVE_CORESERVICES_CORESERVICES_H 1331 CFMutableStringRef string; 1332 char buffer[WI_PATH_SIZE]; 1333 1334 string = CFStringCreateMutable(NULL, 0); 1335 CFStringAppendCString(string, cstring, kCFStringEncodingUTF8); 1336 CFStringNormalize(string, kCFStringNormalizationFormC); 1337 CFStringGetCString(string, buffer, sizeof(buffer), kCFStringEncodingUTF8); 1338 path = wi_string_with_cstring(buffer); 1339 CFRelease(string); 1340 #else 1341 path = wi_string_with_cstring(cstring); 1342 #endif 1343 1344 return path; 1345 } 1346 1347 1348 1322 1349 #pragma mark - 1323 1350 wired/trunk/wired/files.h
r4508 r5064 73 73 wi_boolean_t wd_files_path_is_dropbox(wi_string_t *); 74 74 wi_string_t * wd_files_real_path(wi_string_t *); 75 wi_string_t * wd_files_path_with_decomposed_cstring(const char *); 75 76 76 77
