mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpgtar: Make --files-from and --null work as described.
* tools/gpgtar-create.c (gpgtar_create): Add args files_from and null_names. Improve reading from a file. * tools/gpgtar.c: Make global vars static. (main): Remove tests for --files-from and --null option combinations. Pass option variables to gpgtar_create. -- GnuPG-bug-id: 5027 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
32aac55875
commit
e276f63e4a
6 changed files with 100 additions and 27 deletions
|
@ -213,6 +213,36 @@ trim_spaces( char *str )
|
|||
return str ;
|
||||
}
|
||||
|
||||
|
||||
/* Same as trim_spaces but only condider, space, tab, cr and lf as space. */
|
||||
char *
|
||||
ascii_trim_spaces (char *str)
|
||||
{
|
||||
char *string, *p, *mark;
|
||||
|
||||
string = str;
|
||||
|
||||
/* Find first non-ascii space character. */
|
||||
for (p=string; *p && ascii_isspace (*p); p++)
|
||||
;
|
||||
/* Move characters. */
|
||||
for (mark=NULL; (*string = *p); string++, p++ )
|
||||
{
|
||||
if (ascii_isspace (*p))
|
||||
{
|
||||
if (!mark)
|
||||
mark = string;
|
||||
}
|
||||
else
|
||||
mark = NULL ;
|
||||
}
|
||||
if (mark)
|
||||
*mark = '\0' ; /* Remove trailing spaces. */
|
||||
|
||||
return str ;
|
||||
}
|
||||
|
||||
|
||||
/****************
|
||||
* remove trailing white spaces
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue