Tatsuhiro Tsujikawa 14 年 前
コミット
c4e66390ac

+ 2 - 1
src/CookieStorage.cc

@@ -386,7 +386,8 @@ bool CookieStorage::load(const std::string& filename, time_t now)
 
 bool CookieStorage::saveNsFormat(const std::string& filename)
 {
-  std::string tempfilename = filename+"__temp";
+  std::string tempfilename = filename;
+  tempfilename += "__temp";
   {
     BufferedFile fp(tempfilename, BufferedFile::WRITE);
     if(!fp) {

+ 2 - 1
src/DHTRoutingTableSerializer.cc

@@ -78,7 +78,8 @@ void DHTRoutingTableSerializer::setNodes
 void DHTRoutingTableSerializer::serialize(const std::string& filename)
 {
   A2_LOG_INFO(fmt("Saving DHT routing table to %s.", filename.c_str()));
-  std::string filenameTemp = filename+"__temp";
+  std::string filenameTemp = filename;
+  filenameTemp += "__temp";
   BufferedFile fp(filenameTemp, BufferedFile::WRITE);
   if(!fp) {
     throw DL_ABORT_EX(fmt("Failed to save DHT routing table to %s.",

+ 2 - 1
src/DefaultBtProgressInfoFile.cc

@@ -111,7 +111,8 @@ bool DefaultBtProgressInfoFile::isTorrentDownload()
 void DefaultBtProgressInfoFile::save()
 {
   A2_LOG_INFO(fmt(MSG_SAVING_SEGMENT_FILE, filename_.c_str()));
-  std::string filenameTemp = filename_+"__temp";
+  std::string filenameTemp = filename_;
+  filenameTemp += "__temp";
   {
     BufferedFile fp(filenameTemp, BufferedFile::WRITE);
     if(!fp) {

+ 2 - 1
src/SessionSerializer.cc

@@ -63,7 +63,8 @@ SessionSerializer::SessionSerializer
 
 bool SessionSerializer::save(const std::string& filename) const
 {
-  std::string tempFilename = strconcat(filename, "__temp");
+  std::string tempFilename = filename;
+  tempFilename += "__temp";
   {
     BufferedFile fp(tempFilename, BufferedFile::WRITE);
     if(!fp) {

+ 2 - 1
src/util.cc

@@ -1346,7 +1346,8 @@ bool saveAs
   if(!overwrite && File(filename).exists()) {
     return false;
   }
-  std::string tempFilename = strconcat(filename, "__temp");
+  std::string tempFilename = filename;
+  tempFilename += "__temp";
   {
     BufferedFile fp(tempFilename, BufferedFile::WRITE);
     if(!fp) {