File src/cmdline.c changed (mode: 100644) (index 702e81848..164f5d821) |
... |
... |
cmd_ctrl_i(struct key_info key_info, struct keys_info *keys_info) |
606 |
606 |
return; |
return; |
607 |
607 |
|
|
608 |
608 |
if(input_stat.line == NULL) |
if(input_stat.line == NULL) |
609 |
|
input_stat.line = wcsdup(L""); |
|
|
609 |
|
{ |
|
610 |
|
input_stat.line = my_wcsdup(L""); |
|
611 |
|
if(input_stat.line == NULL) |
|
612 |
|
return; |
|
613 |
|
} |
610 |
614 |
|
|
611 |
615 |
line_completion(&input_stat); |
line_completion(&input_stat); |
612 |
616 |
len = (1 + input_stat.len + line_width - 1 + 1)/line_width; |
len = (1 + input_stat.len + line_width - 1 + 1)/line_width; |
|
... |
... |
file_completion(char* filename, char* line_mb, struct line_stats *stat) |
1336 |
1340 |
x = *temp; |
x = *temp; |
1337 |
1341 |
*temp = '\0'; |
*temp = '\0'; |
1338 |
1342 |
|
|
1339 |
|
/* I'm really worry about the portability... */ |
|
1340 |
|
// temp2 = (wchar_t *) wcsdup(stat->line + stat->index) |
|
1341 |
|
temp2 = (wchar_t *) malloc((wcslen(stat->line |
|
1342 |
|
+ stat->index) + 1) * sizeof(wchar_t)); |
|
|
1343 |
|
temp2 = my_wcsdup(stat->line + stat->index); |
1343 |
1344 |
if(temp2 == NULL) |
if(temp2 == NULL) |
1344 |
|
{ |
|
1345 |
|
free(temp2); |
|
1346 |
1345 |
return -1; |
return -1; |
1347 |
|
} |
|
1348 |
|
wcscpy(temp2, stat->line + stat->index); |
|
1349 |
1346 |
|
|
1350 |
1347 |
i = mbstowcs(NULL, line_mb, 0) + mbstowcs(NULL, filename, 0) |
i = mbstowcs(NULL, line_mb, 0) + mbstowcs(NULL, filename, 0) |
1351 |
1348 |
+ (stat->len - stat->index) + 1; |
+ (stat->len - stat->index) + 1; |