diff options
| author | sc0w <[email protected]> | 2016-05-21 23:03:39 +0200 | 
|---|---|---|
| committer | sc0w <[email protected]> | 2016-05-21 23:03:39 +0200 | 
| commit | 28f01343816e6dd69a80f36947b0ea4297462550 (patch) | |
| tree | 0c5b2e84dbc2ffe536dc02379f075e84d26b6174 | |
| parent | ec986c2ac62822baaa217a2e1c6e27a0762d4561 (diff) | |
| download | engrampa-28f01343816e6dd69a80f36947b0ea4297462550.tar.bz2 engrampa-28f01343816e6dd69a80f36947b0ea4297462550.tar.xz | |
7z: Fixed problems with files prefixed '@'
Fixes #138
| -rw-r--r-- | src/fr-command-7z.c | 33 | 
1 files changed, 30 insertions, 3 deletions
| diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c index 316df11..20cfa2c 100644 --- a/src/fr-command-7z.c +++ b/src/fr-command-7z.c @@ -371,11 +371,20 @@ fr_command_7z_add (FrCommand     *comm,  	if (from_file != NULL)  		fr_process_add_arg_concat (comm->process, "-i@", from_file, NULL); +	if (from_file == NULL) +		for (scan = file_list; scan; scan = scan->next) +			/* Files prefixed with '@' need to be handled specially */ +			if (g_str_has_prefix (scan->data, "@")) +				fr_process_add_arg_concat (comm->process, "-i!", scan->data, NULL); +  	fr_process_add_arg (comm->process, "--");  	fr_process_add_arg (comm->process, comm->filename); +  	if (from_file == NULL)  		for (scan = file_list; scan; scan = scan->next) -			fr_process_add_arg (comm->process, scan->data); +			/* Skip files prefixed with '@', already added */ +			if (!g_str_has_prefix (scan->data, "@")) +				fr_process_add_arg (comm->process, scan->data);  	fr_process_end_command (comm->process);  } @@ -399,11 +408,20 @@ fr_command_7z_delete (FrCommand  *comm,  	if (from_file != NULL)  		fr_process_add_arg_concat (comm->process, "-i@", from_file, NULL); +	if (from_file == NULL) +		for (scan = file_list; scan; scan = scan->next) +			/* Files prefixed with '@' need to be handled specially */ +			if (g_str_has_prefix (scan->data, "@")) +				fr_process_add_arg_concat (comm->process, "-i!", scan->data, NULL); +  	fr_process_add_arg (comm->process, "--");  	fr_process_add_arg (comm->process, comm->filename); +  	if (from_file == NULL)  		for (scan = file_list; scan; scan = scan->next) -			fr_process_add_arg (comm->process, scan->data); +			/* Skip files prefixed with '@', already added */ +			if (!g_str_has_prefix (scan->data, "@")) +				fr_process_add_arg (comm->process, scan->data);  	fr_process_end_command (comm->process);  } @@ -453,11 +471,20 @@ fr_command_7z_extract (FrCommand  *comm,  	if (from_file != NULL)  		fr_process_add_arg_concat (comm->process, "-i@", from_file, NULL); +	if (from_file == NULL) +		for (scan = file_list; scan; scan = scan->next) +			/* Files prefixed with '@' need to be handled specially */ +			if (g_str_has_prefix (scan->data, "@")) +				fr_process_add_arg_concat (comm->process, "-i!", scan->data, NULL); +  	fr_process_add_arg (comm->process, "--");  	fr_process_add_arg (comm->process, comm->filename); +  	if (from_file == NULL)  		for (scan = file_list; scan; scan = scan->next) -			fr_process_add_arg (comm->process, scan->data); +			/* Skip files prefixed with '@', already added */ +			if (!g_str_has_prefix (scan->data, "@")) +				fr_process_add_arg (comm->process, scan->data);  	fr_process_end_command (comm->process);  } | 
