mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-26 07:12:10 -05:00
Ha! Nasty intermittent bug nailed (I think)!
"That word, resLocked: I do not think it means what you think it means." HLock seems to be my friend though. [originally from svn r127]
This commit is contained in:
parent
03b194de40
commit
43e84b26ef
12
maccfg.c
12
maccfg.c
@ -1,11 +1,13 @@
|
||||
/* $Id: maccfg.c,v 1.1.2.3 1999/03/16 20:27:30 ben Exp $ */
|
||||
/* $Id: maccfg.c,v 1.1.2.4 1999/03/23 21:00:05 ben Exp $ */
|
||||
/*
|
||||
* maccfg.c -- Mac port configuration
|
||||
*/
|
||||
|
||||
#include <MacMemory.h>
|
||||
#include <Resources.h>
|
||||
#include <TextUtils.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "putty.h"
|
||||
@ -86,10 +88,10 @@ void mac_loadconfig(Config *cfg) {
|
||||
h = GetResource('pSET', PREF_settings);
|
||||
if (h == NULL || *h == NULL)
|
||||
fatalbox("Can't load settings");
|
||||
if (GetResourceSizeOnDisk(h) != sizeof(struct pSET))
|
||||
HLock(h);
|
||||
if (GetHandleSize(h) != sizeof(struct pSET))
|
||||
fatalbox("Settings resource is wrong size (%d vs %d)",
|
||||
GetResourceSizeOnDisk(h), sizeof(struct pSET));
|
||||
SetResAttrs(h, GetResAttrs(h) | resLocked);
|
||||
GetHandleSize(h), sizeof(struct pSET));
|
||||
s = (struct pSET *)*h;
|
||||
/* Basic */
|
||||
get_string(&s->host, cfg->host, sizeof(cfg->host));
|
||||
@ -131,7 +133,7 @@ void mac_loadconfig(Config *cfg) {
|
||||
/* Selection */
|
||||
cfg->implicit_copy = (s->selection_flags & IMPLICIT_COPY) != 0;
|
||||
get_wordness(s->wordness_id, cfg->wordness);
|
||||
SetResAttrs(h, GetResAttrs(h) & ~resLocked);
|
||||
HUnlock(h);
|
||||
ReleaseResource(h);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user