monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Bug/patch: automate stdio


From: Christian Ohler
Subject: [Monotone-devel] Bug/patch: automate stdio
Date: Sat, 25 Nov 2006 20:40:44 +0100

There's a pretty serious bug in automate stdio in mtn 0.31 and mainline. Under certain circumstances, mtn gets confused reading its input and processes a command that is different from what was sent on stdin.

I believe the attached (one-line) patch fixes this. Unfortunately, I see no easy way for me to provide a test case for this.

Christian.
# 
# old_revision [ba58032764d77f0d6dccc4f4595b8bac1d4e53d8]
# 
# patch "cmd_automate.cc"
#  from [b0f5891cf1cf068c16a39edeaf38c255b6210a0c]
#    to [376d30238bb141c93d14201e55fd697e39a8ca8e]
# 
============================================================
--- cmd_automate.cc     b0f5891cf1cf068c16a39edeaf38c255b6210a0c
+++ cmd_automate.cc     376d30238bb141c93d14201e55fd697e39a8ca8e
@@ -152,7 +152,7 @@ class automate_reader
     size_t got = 0;
     while(got < size)
       {
-        int n = read(str, size-got);
+        int n = read(str+got, size-got);
         got += n;
       }
     out = std::string(str, size);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]