fixed storing patch scripts to target store (#159928)
authorJiri Srain <jsrain@suse.cz>
Tue, 11 Apr 2006 14:44:21 +0000 (14:44 +0000)
committerJiri Srain <jsrain@suse.cz>
Tue, 11 Apr 2006 14:44:21 +0000 (14:44 +0000)
package/libzypp.changes
zypp/target/store/serialize.cc

index 34ffbbd..71c2e3c 100644 (file)
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Tue Apr 11 16:41:02 CEST 2006 - jsrain@suse.de
+
+- fixed storing patch scripts to target store (#159928)
+- rev 3058
+
+-------------------------------------------------------------------
 Tue Apr 11 16:24:26 CEST 2006 - kkaempf@suse.de
 
 - if a patch is bad, only skip this patch, not everything
index 199af81..19e2e9d 100644 (file)
@@ -188,7 +188,11 @@ std::string toXML( const Script::constPtr &obj )
   ifstream infile;
   infile.open(obj->do_script().asString().c_str());
   while (infile.good())
-    out << (char) infile.get();
+  {
+    char c = (char)infile.get();
+    if (! infile.eof())
+      out << c;
+  }
   infile.close();
   
   out << "  ]]>" << std::endl;
@@ -202,7 +206,11 @@ std::string toXML( const Script::constPtr &obj )
   // read script
     infile.open(obj->undo_script().asString().c_str());
     while (infile.good())
-      out << (char) infile.get();
+    {
+      char c = (char)infile.get();
+      if (! infile.eof())
+       out << c;
+    }
     infile.close();
   
     out << "  ]]>" << std::endl;