]> git.lyx.org Git - lyx.git/blobdiff - src/support/unlink.C
* src/text2.C: deleteEmptyParagraphMechanism(): fix a crash in
[lyx.git] / src / support / unlink.C
index 2c5d78f8f1fb7a09005067026e7e554ac6b20666..a8ebc138d8b8ccb64b27ccee77000f3796dceef8 100644 (file)
@@ -3,18 +3,28 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#include <unistd.h>
+#include "support/lyxlib.h"
+#include "support/filename.h"
 
-#include "lyxlib.h"
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 
-int lyx::support::unlink(string const & pathname)
+namespace lyx {
+namespace support {
+
+int unlink(FileName const & pathname)
 {
-       return ::unlink(pathname.c_str());
+       return ::unlink(pathname.toFilesystemEncoding().c_str());
 }
+
+
+} // namespace support
+} // namespace lyx