File src/commands.c changed (mode: 100644) (index e3dfe1a62..bf6c34273) |
... |
... |
split_path(void) |
1449 |
1449 |
|
|
1450 |
1450 |
path = env_get("PATH"); |
path = env_get("PATH"); |
1451 |
1451 |
|
|
|
1452 |
|
if(paths != NULL) |
|
1453 |
|
free_string_array(paths, paths_count); |
|
1454 |
|
|
1452 |
1455 |
paths_count = 1; |
paths_count = 1; |
1453 |
1456 |
p = path; |
p = path; |
1454 |
1457 |
while((p = strchr(p, ':')) != NULL) |
while((p = strchr(p, ':')) != NULL) |
|
... |
... |
expand_macros(FileView *view, const char *command, const char *args, |
2102 |
2105 |
} |
} |
2103 |
2106 |
assert(x >= y); |
assert(x >= y); |
2104 |
2107 |
assert(y <= cmd_len); |
assert(y <= cmd_len); |
2105 |
|
expanded = realloc(expanded, len + cmd_len + 1); |
|
|
2108 |
|
expanded = realloc(expanded, len + (x - y) + 1); |
2106 |
2109 |
strncat(expanded, command + y, x - y); |
strncat(expanded, command + y, x - y); |
2107 |
2110 |
len = strlen(expanded); |
len = strlen(expanded); |
2108 |
2111 |
x++; |
x++; |
2109 |
2112 |
} |
} |
2110 |
2113 |
while(x < cmd_len); |
while(x < cmd_len); |
2111 |
2114 |
|
|
2112 |
|
len++; |
|
2113 |
|
expanded[len] = '\0'; |
|
2114 |
2115 |
if(len > cfg.max_args/2) |
if(len > cfg.max_args/2) |
2115 |
2116 |
(void)show_error_msg("Argument is too long", " FIXME "); |
(void)show_error_msg("Argument is too long", " FIXME "); |
2116 |
2117 |
|
|
File src/filelist.c changed (mode: 100644) (index 204873ba6..a4a895462) |
... |
... |
void |
533 |
533 |
get_all_selected_files(FileView *view) |
get_all_selected_files(FileView *view) |
534 |
534 |
{ |
{ |
535 |
535 |
int x; |
int x; |
536 |
|
int y = 0; |
|
|
536 |
|
int y; |
537 |
537 |
|
|
538 |
538 |
count_selected(view); |
count_selected(view); |
539 |
539 |
|
|
|
... |
... |
get_all_selected_files(FileView *view) |
548 |
548 |
if(view->selected_filelist != NULL) |
if(view->selected_filelist != NULL) |
549 |
549 |
{ |
{ |
550 |
550 |
free_selected_file_array(view); |
free_selected_file_array(view); |
551 |
|
/* restoring this because free_selected_file_array sets it to zero */ |
|
552 |
|
view->selected_files = y; |
|
|
551 |
|
/* setting this because free_selected_file_array doesn't do it */ |
|
552 |
|
view->selected_files = 0; |
553 |
553 |
} |
} |
554 |
|
view->selected_filelist = |
|
555 |
|
(char **)calloc(view->selected_files, sizeof(char *)); |
|
|
554 |
|
count_selected(view); |
|
555 |
|
view->selected_filelist = calloc(view->selected_files, sizeof(char *)); |
556 |
556 |
if(view->selected_filelist == NULL) |
if(view->selected_filelist == NULL) |
557 |
557 |
{ |
{ |
558 |
558 |
(void)show_error_msg("Memory Error", "Unable to allocate enough memory"); |
(void)show_error_msg("Memory Error", "Unable to allocate enough memory"); |