mirror of https://github.com/macssh/macssh.git
Modify getprefsd() to take a Pascal string as 'name'
This commit is contained in:
parent
d59263d9df
commit
28dacfe5d5
|
@ -53,7 +53,7 @@
|
|||
#include <sys/stat.h>
|
||||
|
||||
extern void ssh2_init();
|
||||
extern char *getprefsd(char *name, char * buf, size_t size, short *vRefNum, long *parID);
|
||||
extern char *getprefsd(ConstStringPtr name, char * buf, size_t size, short *vRefNum, long *parID);
|
||||
|
||||
/*--------------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -325,7 +325,7 @@ void DoTheGlobalInits(void)
|
|||
{
|
||||
long junk = 0;
|
||||
ParamBlockRec pb;
|
||||
char folderString[256];
|
||||
Str255 folderString;
|
||||
int err;
|
||||
char *buf;
|
||||
|
||||
|
@ -371,10 +371,7 @@ void DoTheGlobalInits(void)
|
|||
TelInfo->SysFolder.name[0]=0;
|
||||
|
||||
/* NONO */
|
||||
GetIndString((unsigned char *)folderString,MISC_STRINGS,PREFS_FOLDER_NAME);
|
||||
junk = folderString[0];
|
||||
BlockMoveData(folderString + 1, folderString, junk);
|
||||
folderString[junk] = 0;
|
||||
GetIndString(folderString,MISC_STRINGS,PREFS_FOLDER_NAME);
|
||||
// WARNING: this initializes GUSI which in turn calls our event handler...
|
||||
buf = getprefsd(folderString, NULL, 0, &TelInfo->PrefFolder.vRefNum, &TelInfo->PrefFolder.parID);
|
||||
if ( !buf ) {
|
||||
|
|
|
@ -60,7 +60,7 @@ extern "C" {
|
|||
void ssh2_init();
|
||||
void ssh2_sched();
|
||||
|
||||
char *getprefsd(char *name, char *buf, size_t size, short *vRefNum, long *parID);
|
||||
char *getprefsd(ConstStringPtr name, char *buf, size_t size, short *vRefNum, long *parID);
|
||||
|
||||
int open(const char * path, int mode, ...);
|
||||
int dup(int s);
|
||||
|
@ -116,7 +116,7 @@ void ssh2_sched()
|
|||
* getprefsd return the full path of prefs directory
|
||||
*/
|
||||
|
||||
char *getprefsd(char *name, char *buf, size_t size, short *vRefNum, long *dirID)
|
||||
char *getprefsd(ConstStringPtr name, char *buf, size_t size, short *vRefNum, long *dirID)
|
||||
{
|
||||
OSErr err;
|
||||
FSSpec fileSpec;
|
||||
|
@ -130,8 +130,7 @@ char *getprefsd(char *name, char *buf, size_t size, short *vRefNum, long *dirID)
|
|||
if (err) {
|
||||
return NULL;
|
||||
}
|
||||
fileSpec.name[0] = strlen(name);
|
||||
BlockMoveData(name, fileSpec.name + 1, fileSpec.name[0]);
|
||||
PLstrcpy(fileSpec.name, name);
|
||||
err = ResolveAliasFile(&fileSpec, true, &isFolder, &wasAlias);
|
||||
err = FSpGetDirectoryID(&fileSpec, dirID, &isDirectory);
|
||||
if (err == fnfErr) {
|
||||
|
|
|
@ -82,7 +82,7 @@ extern RSdata *RSlocal;
|
|||
|
||||
extern void ssh2_init();
|
||||
extern void ssh2_sched();
|
||||
extern char *getprefsd(char *name, char *buf, size_t size, short *vRefNum, long *parID);
|
||||
extern char *getprefsd(ConstStringPtr name, char *buf, size_t size, short *vRefNum, long *parID);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
|
|
Loading…
Reference in New Issue