Changeset 3820
- Timestamp:
- 02/27/06 21:20:15 (3 years ago)
- Files:
-
- wire/trunk/wire/client.c (modified) (7 diffs)
- wire/trunk/wire/files.c (modified) (4 diffs)
- wire/trunk/wire/main.c (modified) (2 diffs)
- wire/trunk/wire/transfers.c (modified) (3 diffs)
- wire/trunk/wire/windows.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wire/trunk/wire/client.c
r3802 r3820 304 304 305 305 string = wi_string_by_converting_encoding(buffer, wr_server_string_encoding, wr_client_string_encoding); 306 306 307 wi_parse_wired_message(string, &message, &arguments); 307 wi_release(string);308 308 309 309 switch(message) { … … 497 497 498 498 password = wi_string_length(wr_password) == 0 ? NULL : wi_string_sha1(wr_password); 499 499 500 wr_send_command(WI_STR("PASS %#@"), password); 500 wi_release(password);501 501 502 502 wr_send_command(WI_STR("WHO %u"), 1); … … 778 778 name, transferred, size, speed); 779 779 } 780 781 wi_release(name);782 780 } 783 784 wi_release(array);785 781 } 786 787 wi_release(transfers);788 782 } 789 783 } … … 984 978 static void wr_msg_402(wi_array_t *arguments) { 985 979 wi_date_t *date; 986 wi_string_t *path, * name, *kind, *string;980 wi_string_t *path, *kind, *string; 987 981 wr_transfer_t *transfer; 988 982 wi_file_offset_t size; … … 994 988 995 989 if(wr_stat_state == WR_STAT_FILE) { 996 name = wi_string_last_path_component(path); 997 wr_printf_prefix(WI_STR("File info for %@:"), name); 998 wi_release(name); 990 wr_printf_prefix(WI_STR("File info for %@:"), wi_string_last_path_component(path)); 999 991 1000 992 wr_printf_block(WI_STR("Path: %@"), path); … … 1078 1070 wr_file_t *file; 1079 1071 1080 file = wr_file_init(wr_file_alloc()); 1081 1082 file->type = wi_string_unsigned_int_value(WI_ARRAY(arguments, 1)); 1083 file->size = wi_string_unsigned_int_value(WI_ARRAY(arguments, 2)); 1084 file->path = wi_retain(WI_ARRAY(arguments, 0)); 1085 file->name = wi_string_last_path_component(file->path); 1072 file = wr_file_init(wr_file_alloc()); 1073 file->type = wi_string_unsigned_int_value(WI_ARRAY(arguments, 1)); 1074 file->size = wi_string_unsigned_int_value(WI_ARRAY(arguments, 2)); 1075 file->path = wi_retain(WI_ARRAY(arguments, 0)); 1076 file->name = wi_retain(wi_string_last_path_component(file->path)); 1086 1077 1087 1078 wi_list_append_data(wr_files, file); … … 1116 1107 wr_file_t *file; 1117 1108 1118 file = wr_file_init(wr_file_alloc()); 1119 1120 file->type = wi_string_unsigned_int_value(WI_ARRAY(arguments, 1)); 1121 file->size = wi_string_unsigned_int_value(WI_ARRAY(arguments, 2)); 1122 file->path = wi_retain(WI_ARRAY(arguments, 0)); 1123 file->name = wi_string_last_path_component(file->path); 1109 file = wr_file_init(wr_file_alloc()); 1110 file->type = wi_string_unsigned_int_value(WI_ARRAY(arguments, 1)); 1111 file->size = wi_string_unsigned_int_value(WI_ARRAY(arguments, 2)); 1112 file->path = wi_retain(WI_ARRAY(arguments, 0)); 1113 file->name = wi_retain(wi_string_last_path_component(file->path)); 1124 1114 1125 1115 wi_list_append_data(wr_files, file); wire/trunk/wire/files.c
r3819 r3820 85 85 wi_string_t *path, *full_path, *name; 86 86 wr_file_t *file; 87 char *cname , *match = NULL;87 char *cname; 88 88 wi_boolean_t root; 89 89 … … 95 95 wi_release(directory_path); 96 96 97 directory_path = wi_string_by_deleting_last_path_component(path);98 full_path = wr_files_full_path(directory_path);97 directory_path = wi_retain(wi_string_by_deleting_last_path_component(path)); 98 full_path = wr_files_full_path(directory_path); 99 99 100 100 wr_clear_files(); … … 119 119 120 120 full_path = wi_string_by_appending_path_component(directory_path, file->name); 121 match = strdup(wi_string_cstring(full_path)); 122 wi_release(full_path); 123 124 break; 121 122 return strdup(wi_string_cstring(full_path)); 125 123 } 126 124 } 127 125 128 wi_release(name); 129 130 return match; 126 return NULL; 131 127 } 132 128 … … 141 137 fullpath = wi_autorelease(wi_copy(path)); 142 138 else 143 fullpath = wi_ autorelease(wi_string_by_appending_path_component(wr_files_cwd, path));139 fullpath = wi_string_by_appending_path_component(wr_files_cwd, path); 144 140 145 141 wi_string_normalize_path(fullpath); wire/trunk/wire/main.c
r3795 r3820 146 146 else 147 147 wr_printf_prefix(WI_STR("%@: %m"), path); 148 149 wi_release(path);150 148 151 149 /* read specified bookmark */ 152 150 if(*argv) { 153 component = wi_string_with_cstring(*argv);154 path = wi_string_by_appending_path_component(wirepath, component);155 file = wi_file_for_reading(path);151 component = wi_string_with_cstring(*argv); 152 path = wi_string_by_appending_path_component(wirepath, component); 153 file = wi_file_for_reading(path); 156 154 157 155 if(file) … … 159 157 else 160 158 wr_printf_prefix(WI_STR("%@: %m"), path); 161 162 wi_release(path); 163 } 164 165 wi_release(wirepath); 159 } 160 166 161 wi_release(pool); 167 162 wire/trunk/wire/transfers.c
r3795 r3820 150 150 transfer = wi_autorelease(wr_transfer_init_download(wr_transfer_alloc())); 151 151 transfer->path = wi_retain(wr_files_full_path(path)); 152 transfer->name = wi_ string_last_path_component(transfer->path);152 transfer->name = wi_retain(wi_string_last_path_component(transfer->path)); 153 153 transfer->local_path = wi_retain(wi_user_home()); 154 154 wi_string_append_path_component(transfer->local_path, transfer->name); … … 195 195 196 196 transfer = wi_autorelease(wr_transfer_init_upload(wr_transfer_alloc())); 197 transfer->local_path = wi_ string_by_expanding_tilde_in_path(path);197 transfer->local_path = wi_retain(wi_string_by_expanding_tilde_in_path(path)); 198 198 wi_string_normalize_path(transfer->local_path); 199 transfer->name = wi_ string_last_path_component(transfer->local_path);199 transfer->name = wi_retain(wi_string_last_path_component(transfer->local_path)); 200 200 transfer->path = wi_retain(wr_files_full_path(transfer->name)); 201 201 … … 294 294 295 295 path = wi_string_by_deleting_path_extension(transfer->local_path); 296 296 297 wi_file_rename(transfer->local_path, path); 297 wi_release(path);298 298 } else { 299 299 wr_printf_prefix(WI_STR("Transfer of \"%@\" stopped"), wire/trunk/wire/windows.c
r3790 r3820 375 375 wr_wprintf(window, WI_STR(" %@"), WI_ARRAY(array, i)); 376 376 377 wi_release(array);378 377 wi_release(string); 379 378 } … … 433 432 WR_END_COLOR, 434 433 chat); 435 436 wi_release(prefix);437 434 } 438 435 … … 470 467 color ? WR_END_COLOR : "", 471 468 chat); 472 473 wi_release(prefix);474 469 } 475 470
