From e4e6315ff4341c77efbf575dac1502b349aeecb1 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Tue, 21 Feb 2017 19:10:16 -0800 Subject: [PATCH] PackageInstaller: Use newly created BString::IEndsWith() ...to find files with .pdb extension Code was subtly wrong in 2 cases: 1) File that ended in pdb but not an extension e.g. filepdb erroneously included 2) File that ended in .PDB or other case erroneously skipped --- src/apps/packageinstaller/UninstallView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/packageinstaller/UninstallView.cpp b/src/apps/packageinstaller/UninstallView.cpp index e3fc522ec4..35c0217108 100644 --- a/src/apps/packageinstaller/UninstallView.cpp +++ b/src/apps/packageinstaller/UninstallView.cpp @@ -361,8 +361,8 @@ UninstallView::_ReloadAppList() if (iter.GetNodeRef(&ref) != B_OK) continue; - size_t len = strnlen(filename, B_FILE_NAME_LENGTH); - if (len < 3 || strncmp(filename + (len - 3), "pdb", 3) != 0) { + BString filenameString(filename); + if (!filenameString.IEndsWith(".pdb")) { printf("Ignoring non-package '%s'\n", filename); continue; }