[tor-commits] [tor/master] Better log message when writing a CR in text mode on windows

nickm at torproject.org nickm at torproject.org
Thu May 1 16:38:04 UTC 2014


commit 234dfb0c65bb4239d5fc497df10d1759c3577af2
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Mar 27 23:48:17 2014 -0400

    Better log message when writing a CR in text mode on windows
    
    Help to diagnose #11233
---
 changes/bug11233  |    4 ++++
 src/common/util.c |    3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/changes/bug11233 b/changes/bug11233
new file mode 100644
index 0000000..1161b6d
--- /dev/null
+++ b/changes/bug11233
@@ -0,0 +1,4 @@
+  o Minor features:
+    - When we encounter an unexpected CR in text that we're trying to
+      write to a file on Windows, log the name of the file.  Should help
+      diagnosing bug 11233.
diff --git a/src/common/util.c b/src/common/util.c
index a0adb15..79e2860 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -2002,7 +2002,8 @@ write_str_to_file(const char *fname, const char *str, int bin)
 #ifdef _WIN32
   if (!bin && strchr(str, '\r')) {
     log_warn(LD_BUG,
-             "We're writing a text string that already contains a CR.");
+             "We're writing a text string that already contains a CR to %s",
+             escaped(fname));
   }
 #endif
   return write_bytes_to_file(fname, str, strlen(str), bin);





More information about the tor-commits mailing list