ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/xmlTools/trunk/posUpdate/XmlPatch.cs
(Generate patch)

Comparing xmlTools/trunk/posUpdate/XmlPatch.cs (file contents):
Revision 742 by s10k, Tue Mar 26 02:30:48 2013 UTC vs.
Revision 746 by s10k, Tue Mar 26 15:23:42 2013 UTC

# Line 284 | Line 284 | namespace xmlTools
284                      string paramType = "";
285  
286                      // Filename already exists?
287 <                    if (command.IndexOf("filename:") != -1)
287 >                    if (Util.ContainsIgnoreCase(command,"filename:"))
288                      {
289                          paramType = "filename:";
290                      }
291 <                    else if (command.IndexOf("filename=") != -1)
291 >                    else if (Util.ContainsIgnoreCase(command, "filename="))
292                      {
293                          paramType = "filename=";
294                      }
295                      // Add the filename if it doesn't exists
296                      else
297                      {
298 <                        command = command.Insert(command.Length-1," -filename:" + this.forceFiles); // -1 to be inside quotes
298 >                        command = command.Insert(command.Length," -filename:" + this.forceFiles);
299                      }
300  
301                      if (paramType != "")
# Line 304 | Line 304 | namespace xmlTools
304                          int endIdx = command.IndexOf(" ", startIdx); // it may end with space
305                          if (endIdx == -1)
306                          {
307 <                            endIdx = command.IndexOf("\"", startIdx); // or with quotes
307 >                            endIdx = command.IndexOf("\n", startIdx); // or with endline
308                          }
309                          string currFilename = command.Substring(startIdx, endIdx - startIdx);
310                          command = command.Replace(currFilename, this.forceFiles);
# Line 314 | Line 314 | namespace xmlTools
314  
315                  if (this.globalNoBackups && !Util.ContainsIgnoreCase(command,"nobackups")) // add noBackup flag if provided as global parameter
316                  {
317 <                    command = command.Insert(command.Length - 1, " -nobackups"); // -1 to be inside quotes
317 >                    command = command.Insert(command.Length, " -nobackups");
318                  }
319  
320 <                command = command.Replace("\"", ""); // remove quotes
321 <
322 <                Program.Main(command.Split(' ')); // use the current process is more efficient than start a new one
320 >                Program.Main(Util.stringToArgsArray(command)); // use the current process is more efficient than start a new one
321              }
322              catch (Exception e)
323              {

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)