Skip to content

Commit 83eb485

Browse files
committed
Some more error checking
1 parent b0e5e99 commit 83eb485

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

WindowsPathEditor/MainWindow.xaml.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private void CanExplore(object sender, CanExecuteRoutedEventArgs e)
282282
}
283283
catch (Exception ex)
284284
{
285-
Debug.Print("Exception in CanExplor: {0}", ex);
285+
Debug.Print("Exception in CanExplore: {0}", ex);
286286
}
287287
}
288288

@@ -299,7 +299,10 @@ private void CanDelete(object sender, CanExecuteRoutedEventArgs e)
299299

300300
private string PathAsCommandLineArgument(IEnumerable<AnnotatedPathEntry> path)
301301
{
302-
return "\"" + string.Join(";", path) + "\"";
302+
string arg = string.Join(";", path);
303+
if (arg.Contains("\""))
304+
throw new InvalidDataException("Error saving: path string contains \" character");
305+
return "\"" + arg + "\"";
303306
}
304307

305308
private IEnumerable<PathEntry> ParseCommandLinePath(string argument)

WindowsPathEditor/UAC.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public static bool Relaunch(string arguments, bool elevated)
5353
info.FileName = Assembly.GetEntryAssembly().GetName().CodeBase;
5454
info.Arguments = arguments;
5555

56+
Debug.Print("Launching {0} {1}", info.FileName, info.Arguments);
57+
5658
if (elevated)
5759
{
5860
info.UseShellExecute = true;

0 commit comments

Comments
 (0)