Hi,

I noticed a problem where my log4cxx-enabled apps just seemed to be hanging
infinitely on startup.
It turned out that some of the log filenames (user configurable) where being
passed with backslashes (Windows environment), and I traced it to what looks
like a bug in File::convertBackSlashes:

std::string File::convertBackSlashes(const std::string& src) {
  std::string::size_type pos = src.find('\\');
  if (pos == std::string::npos) {
    return src;
  }
  std::string mod(src);
  while(pos != std::string::npos) {
    mod[pos] = '/';
-    pos = src.find('\\');
+    pos = mod.find('\\');
  }
  return mod;
}

If it just keeps looking in the original source-string, it keeps finding the
same backslash over and over.

Kind regards,

-- Iwan Tomlow

Reply via email to