pathins fix
This commit is contained in:
38
map.c
38
map.c
@@ -437,15 +437,17 @@ static int set_search_native(uint8 *drvstr, NWPATH *nwp, int pathmode)
|
||||
strmaxcpy(p->dospath, nwp->path+2, sizeof(p->dospath)-1);
|
||||
result = set_search_drive_vektor(drives);
|
||||
} else {
|
||||
int dhandle = alloc_permanent_dir_handle(0, nwp->path, 0, NULL);
|
||||
if (dhandle >= 0) {
|
||||
p->flags = 1;
|
||||
p->drivenummer = 0xfe;
|
||||
*(p->dospath) = '\0';
|
||||
p->connid = 1;
|
||||
p->dhandle = (uint8)dhandle;
|
||||
result = set_search_drive_vektor(drives);
|
||||
}
|
||||
/*
|
||||
* Search path entries are not drive mappings. The original code stores
|
||||
* the NetWare path text directly in dospath with drivenummer=0xfe.
|
||||
* Client32 keeps/prints these entries correctly; allocating a permanent
|
||||
* directory handle here made set_search_drive_vektor() return success,
|
||||
* but the entry did not actually replace SEARCH1.
|
||||
*/
|
||||
p->flags = 0;
|
||||
p->drivenummer = 0xfe;
|
||||
strmaxcpy(p->dospath, nwp->path, sizeof(p->dospath)-1);
|
||||
result = set_search_drive_vektor(drives);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,29 +460,23 @@ int func_path(int argc, char *argv[], int mode)
|
||||
uint8 drvstr[22];
|
||||
NWPATH nwpath;
|
||||
int rc;
|
||||
int i;
|
||||
|
||||
fprintf(stderr, "PATHDBG mode=%d argc=%d", mode, argc);
|
||||
for (i = 0; i < argc; i++)
|
||||
fprintf(stderr, " argv[%d]='%s'", i, argv[i]);
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
/*
|
||||
* PATH/PATHINS/PATHDEL need their own parser. The old parse_argv()
|
||||
* rejects common login-script syntax such as:
|
||||
* PATHINS S1:=SYS:PUBLIC
|
||||
* MAP INS S1:=SYS:PUBLIC
|
||||
*/
|
||||
if (argc < 2) {
|
||||
show_search("");
|
||||
return(0);
|
||||
}
|
||||
|
||||
rc = parse_pathins_arg(drvstr, &nwpath, argc, argv, mode);
|
||||
fprintf(stderr, "PATHDBG parse rc=%d drv0=%u drv1=%u path='%s'\n",
|
||||
rc, drvstr[0], drvstr[1], rc ? "" : nwpath.path);
|
||||
|
||||
if (!rc) {
|
||||
int result=0;
|
||||
if (*(nwpath.path) || mode==1)
|
||||
result=set_search_native(drvstr, &nwpath, mode);
|
||||
|
||||
fprintf(stderr, "PATHDBG set result=%d\n", result);
|
||||
|
||||
if (mode != 1)
|
||||
show_search(drvstr);
|
||||
return(result);
|
||||
|
||||
Reference in New Issue
Block a user