diff --git a/SystemTools.cxx b/SystemTools.cxx
index 66850e9ac823580c272fd0baee2da5fea16d6ea9..085d988360cc7fcf569a4828512077f722353628 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -1665,7 +1665,7 @@ kwsys_stl::string SystemTools::EscapeChars(
   kwsys_stl::string n;
   if (str)
     {
-    if (!chars_to_escape | !*chars_to_escape)
+    if (!chars_to_escape || !*chars_to_escape)
       {
       n.append(str);
       }