From 1f904d1e036ed90e47efc679889382f083fd0531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 8 Apr 2009 08:23:07 +0000 Subject: [PATCH] * If you do something, please try to do it right, or at least test it. * The alert escape check was broken in several ways. First of all, the buttons can be NULL which suddenly crashed apps. Second of all, the check didn't even work as it was reversed. * Also, I disabled the code for now, as I really don't think string comparison heuristics are the way to solve this. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30018 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/FilePanelPriv.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kits/tracker/FilePanelPriv.cpp b/src/kits/tracker/FilePanelPriv.cpp index 9010df4418..cebc6767ed 100644 --- a/src/kits/tracker/FilePanelPriv.cpp +++ b/src/kits/tracker/FilePanelPriv.cpp @@ -1390,15 +1390,15 @@ TFilePanel::ShowCenteredAlert(const char *text, const char *button1, B_WIDTH_AS_USUAL, B_WARNING_ALERT); alert->MoveTo(Frame().left + 10, Frame().top + 10); - if (strncmp(button1, "Cancel", 7)) +#if 0 + if (button1 != NULL && !strncmp(button1, "Cancel", 7)) alert->SetShortcut(0, B_ESCAPE); - - if (strncmp(button2, "Cancel", 7)) + else if (button2 != NULL && !strncmp(button2, "Cancel", 7)) alert->SetShortcut(1, B_ESCAPE); - - if (strncmp(button3, "Cancel", 7)) + else if (button3 != NULL && !strncmp(button3, "Cancel", 7)) alert->SetShortcut(2, B_ESCAPE); - +#endif + return alert->Go(); }