From 7b0352362c187085657973dde237b3ef75d4b57e Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 23 Nov 2002 18:22:47 +0000 Subject: [PATCH] Only try to retrieve a 'vers' resource from the current resource file (the application), rather from the entire chain. This prevents us displaying the System version if PuTTY doesn't have one. Also cope with not finding any 'vers' resource. [originally from svn r2247] --- mac/mac.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mac/mac.c b/mac/mac.c index 2e4bfdf7..9e53c630 100644 --- a/mac/mac.c +++ b/mac/mac.c @@ -1,4 +1,4 @@ -/* $Id: mac.c,v 1.2 2002/11/23 15:11:13 ben Exp $ */ +/* $Id: mac.c,v 1.3 2002/11/23 18:22:47 ben Exp $ */ /* * Copyright (c) 1999 Ben Harris * All rights reserved. @@ -398,13 +398,14 @@ static void mac_openabout(void) { SelectWindow(windows.about); else { windows.about = GetNewDialog(wAbout, NULL, (WindowPtr)-1); - /* XXX check we're using the right resource file? */ - vers = (VersRecHndl)GetResource('vers', 1); - assert(vers != NULL && *vers != NULL); - longvers = (*vers)->shortVersion + (*vers)->shortVersion[0] + 1; - GetDialogItem(windows.about, wiAboutVersion, &itemtype, &item, &box); - assert(itemtype & kStaticTextDialogItem); - SetDialogItemText(item, longvers); + vers = (VersRecHndl)Get1Resource('vers', 1); + if (vers != NULL && *vers != NULL) { + longvers = (*vers)->shortVersion + (*vers)->shortVersion[0] + 1; + GetDialogItem(windows.about, wiAboutVersion, + &itemtype, &item, &box); + assert(itemtype & kStaticTextDialogItem); + SetDialogItemText(item, longvers); + } ShowWindow(windows.about); } }