From: ben Date: Sat, 23 Nov 2002 18:22:47 +0000 (+0000) Subject: Only try to retrieve a 'vers' resource from the current resource file (the X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/5dbc118e6d2e83481e97aee93c6fdb6a7224c9be 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@2247 cda61777-01e9-0310-a592-d414129be87e --- 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); } }