aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog4
-rw-r--r--g10/openfile.c14
2 files changed, 16 insertions, 2 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 7e04eb540..abd95a54a 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,7 @@
+2007-05-07 Werner Koch <[email protected]>
+
+ * openfile.c (open_outfile, overwrite_filep) [W32]: Use "/dev/nul".
+
2007-05-02 David Shaw <[email protected]>
* packet.h, mainproc.c (reset_literals_seen): New function to
diff --git a/g10/openfile.c b/g10/openfile.c
index 381f93bd2..d0be66157 100644
--- a/g10/openfile.c
+++ b/g10/openfile.c
@@ -77,6 +77,10 @@ overwrite_filep( const char *fname )
if ( !strcmp ( fname, "/dev/null" ) )
return 1; /* does not do any harm */
#endif
+#ifdef HAVE_W32_SYSTEM
+ if ( !strcmp ( fname, "/dev/nul" ) )
+ return 1;
+#endif
/* fixme: add some backup stuff in case of overwrite */
if( opt.answer_yes )
@@ -196,8 +200,14 @@ open_outfile( const char *iname, int mode, IOBUF *a )
char *buf = NULL;
const char *name;
- if( opt.dry_run )
- name = "/dev/null";
+ if ( opt.dry_run )
+ {
+#ifdef HAVE_W32_SYSTEM
+ name = "/dev/nul";
+#else
+ name = "/dev/null";
+#endif
+ }
else if( opt.outfile )
name = opt.outfile;
else {