From 0995cc28e394e1eaa47474ca60c58b97a86e3434 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 27 May 2004 12:43:58 +0000 Subject: [PATCH] Don't parse Info.plist if there wasn't a product identifier specified. --- platform_unix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform_unix.c b/platform_unix.c index 6b2a8bf..f515a90 100644 --- a/platform_unix.c +++ b/platform_unix.c @@ -383,9 +383,10 @@ int chdir_by_identifier(const char *name, const char *str, const char *version) Boolean b; OSStatus rc; int found = 0; + int hasident = ((str != NULL) && (*str)); /* if an identifier is specified, ask LaunchServices to find product... */ - if ((str != NULL) && (*str)) + if (hasident) { CFURLRef url = NULL; CFStringRef id = CFStringCreateWithBytes(NULL, str, strlen(str), @@ -427,7 +428,7 @@ int chdir_by_identifier(const char *name, const char *str, const char *version) return(0); } /* if */ - return(parse_info_dot_plist(str, version)); + return(hasident ? parse_info_dot_plist(str, version) : 1); } /* chdir_by_identifier */