]> sjero.net Git - wget/blobdiff - src/main.c
Exit with failure if -k is specified and -O is not a regular file.
[wget] / src / main.c
index b41277ba841355a66c8f49df7f7632676a206b3d..9edec13b67919b4cc942dc3872dc0e39ae6038b7 100644 (file)
@@ -1,6 +1,6 @@
 /* Command line parsing.
-   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
@@ -1217,6 +1217,13 @@ WARNING: Can't reopen standard output in binary mode;\n\
           if (fstat (fileno (output_stream), &st) == 0 && S_ISREG (st.st_mode))
             output_stream_regular = true;
         }
+      if (!output_stream_regular && opt.convert_links)
+        {
+          printf (_("-k can be used together with -O only if outputting to \
+a regular file.\n"));
+          print_usage ();
+          exit(1);
+        }
     }
 
 #ifdef __VMS