aboutsummaryrefslogtreecommitdiffstats
path: root/g10/openfile.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-10-13 09:59:46 +0000
committerWerner Koch <[email protected]>2004-10-13 09:59:46 +0000
commit620ac79ebf8bf6475ed3505b603a4d85a563c314 (patch)
treeaa1a5df7260b166ae3640137188bc153b46a3fe0 /g10/openfile.c
parent* Makefile.am (.S.o): Include MPI_SFLAGS. This is our bug 145. (diff)
downloadgnupg-620ac79ebf8bf6475ed3505b603a4d85a563c314.tar.gz
gnupg-620ac79ebf8bf6475ed3505b603a4d85a563c314.zip
* configure.ac: Actually name the option --disable-finger and not
http. * openfile.c (overwrite_filep, make_outfile_name, open_outfile) (open_sigfile): Use iobuf_is_pipe_filename to check for pipes so that special filesnames are taken into account. This is bug 327. * tdbdump.c (import_ownertrust): Ditto. * sign.c (write_plaintext_packet): Ditto. * progress.c (handle_progress): Ditto. * plaintext.c (handle_plaintext): Ditto. * encode.c (encode_simple, encode_crypt): Ditto. * iobuf.c (iobuf_is_pipe_filename): New. * fileutil.c (is_file_compressed): Use it here.
Diffstat (limited to 'g10/openfile.c')
-rw-r--r--g10/openfile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/g10/openfile.c b/g10/openfile.c
index b3f6e436b..3f52b613b 100644
--- a/g10/openfile.c
+++ b/g10/openfile.c
@@ -64,8 +64,8 @@
int
overwrite_filep( const char *fname )
{
- if( !fname || (*fname == '-' && !fname[1]) )
- return 1; /* writing to stdout is always okay */
+ if( iobuf_is_pipe_filename (fname) )
+ return 1; /* Writing to stdout is always okay */
if( access( fname, F_OK ) )
return 1; /* does not exist */
@@ -98,7 +98,7 @@ make_outfile_name( const char *iname )
{
size_t n;
- if( (!iname || (*iname=='-' && !iname[1]) ))
+ if ( iobuf_is_pipe_filename (iname) )
return m_strdup("-");
n = strlen(iname);
@@ -174,7 +174,7 @@ open_outfile( const char *iname, int mode, IOBUF *a )
int rc = 0;
*a = NULL;
- if( (!iname || (*iname=='-' && !iname[1])) && !opt.outfile ) {
+ if( iobuf_is_pipe_filename (iname) && !opt.outfile ) {
if( !(*a = iobuf_create(NULL)) ) {
log_error(_("%s: can't open: %s\n"), "[stdout]", strerror(errno) );
rc = G10ERR_CREATE_FILE;
@@ -269,7 +269,7 @@ open_sigfile( const char *iname, progress_filter_context_t *pfx )
IOBUF a = NULL;
size_t len;
- if( iname && !(*iname == '-' && !iname[1]) ) {
+ if( !iobuf_is_pipe_filename (iname) ) {
len = strlen(iname);
if( len > 4 && ( !strcmp(iname + len - 4, EXTSEP_S "sig")
|| ( len > 5 && !strcmp(iname + len - 5, EXTSEP_S "sign") )