]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/ConfUtils.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / common / ConfUtils.cc
index db957760bf9a704ca4c6b4b634089966374f8fd3..7c8f1cc78b7f02cdfea3dd26d49a31a9298216a8 100644 (file)
@@ -252,6 +252,10 @@ trim_whitespace(std::string &str, bool strip_internal)
 std::string ConfFile::
 normalize_key_name(const std::string &key)
 {
+  if (key.find_first_of(" \t\r\n\f\v\xa0") == string::npos) {
+    return key;
+  }
+
   string k(key);
   ConfFile::trim_whitespace(k, true);
   std::replace(k.begin(), k.end(), ' ', '_');
@@ -281,7 +285,7 @@ load_from_buffer(const char *buf, size_t sz, std::deque<std::string> *errors,
 
   section_iter_t::value_type vt("global", ConfSection());
   pair < section_iter_t, bool > vr(sections.insert(vt));
-  assert(vr.second);
+  ceph_assert(vr.second);
   section_iter_t cur_section = vr.first;
   std::string acc;
 
@@ -585,6 +589,6 @@ process_line(int line_no, const char *line, std::deque<std::string> *errors)
        ceph_abort();
        break;
     }
-    assert(c != '\0'); // We better not go past the end of the input string.
+    ceph_assert(c != '\0'); // We better not go past the end of the input string.
   }
 }