--- xmlTools/trunk/posUpdate/XmlPatch.cs 2013/03/26 02:30:48 742 +++ xmlTools/trunk/posUpdate/XmlPatch.cs 2013/03/26 15:23:42 746 @@ -284,18 +284,18 @@ namespace xmlTools string paramType = ""; // Filename already exists? - if (command.IndexOf("filename:") != -1) + if (Util.ContainsIgnoreCase(command,"filename:")) { paramType = "filename:"; } - else if (command.IndexOf("filename=") != -1) + else if (Util.ContainsIgnoreCase(command, "filename=")) { paramType = "filename="; } // Add the filename if it doesn't exists else { - command = command.Insert(command.Length-1," -filename:" + this.forceFiles); // -1 to be inside quotes + command = command.Insert(command.Length," -filename:" + this.forceFiles); } if (paramType != "") @@ -304,7 +304,7 @@ namespace xmlTools int endIdx = command.IndexOf(" ", startIdx); // it may end with space if (endIdx == -1) { - endIdx = command.IndexOf("\"", startIdx); // or with quotes + endIdx = command.IndexOf("\n", startIdx); // or with endline } string currFilename = command.Substring(startIdx, endIdx - startIdx); command = command.Replace(currFilename, this.forceFiles); @@ -314,12 +314,10 @@ namespace xmlTools if (this.globalNoBackups && !Util.ContainsIgnoreCase(command,"nobackups")) // add noBackup flag if provided as global parameter { - command = command.Insert(command.Length - 1, " -nobackups"); // -1 to be inside quotes + command = command.Insert(command.Length, " -nobackups"); } - command = command.Replace("\"", ""); // remove quotes - - Program.Main(command.Split(' ')); // use the current process is more efficient than start a new one + Program.Main(Util.stringToArgsArray(command)); // use the current process is more efficient than start a new one } catch (Exception e) {