mars_dosutils-0.10

This commit is contained in:
Mario Fetka
2011-11-13 00:40:40 +01:00
parent 5e6805dd31
commit 975f34431a
18 changed files with 768 additions and 529 deletions

View File

@@ -49,6 +49,8 @@ int logout(void)
int redir_device_drive(int devicetyp, uint8 *devname, uint8 *remotename)
/* if devicetyp == -1, the redir is canceled */
/* devicetyp 3 = printer */
/* devicetyp 4 = disk drive */
{
REGS regs;
SREGS sregs;
@@ -157,16 +159,15 @@ int get_search_drive_vektor(SEARCH_VECTOR_ENTRY *vec)
char *p1 = path;
int len = 0;
while (*path && *path++ !=';') len++;
if (*(p1+1) == ':'
&& *p1 >= 'A' && *p1 <= 'Z' &&
(len==2 || (len == 3 && *(p1+2) == '.'))) {
if (*(p1+1) == ':' && *p1 >= 'A' && *p1 <= 'Z') {
v->drivenummer = *p1 - 'A';
get_drive_info(v->drivenummer, &(v->u.fs.connid),
&(v->u.fs.dhandle), &(v->flags));
get_drive_info(v->drivenummer, &(v->connid),
&(v->dhandle), &(v->flags));
strmaxcpy(v->dospath, p1+2, min(len-2, sizeof(v->dospath)-1));
} else {
v->flags = 0;
v->drivenummer = 0xfe; /* ergibt ? */
strmaxcpy(v->u.d.dospath, p1, len);
strmaxcpy(v->dospath, p1, min(len, sizeof(v->dospath)-1));
}
(++v)->drivenummer = 0xff;
if (*path == ';') path++;
@@ -181,20 +182,29 @@ int set_search_drive_vektor(SEARCH_VECTOR_ENTRY *vec)
char *p=path;
SEARCH_VECTOR_ENTRY *v;
int plen=strlen(path_env_name);
int maxcount=16;
strcpy(path, path_env_name);
path[plen] = '=';
path[++plen] = '\0';
while ((NULL != (v = vec++)) && v->drivenummer != 0xff){
if (p > path) *p++=';';
else p+=plen;
if (v->drivenummer < 26) {
*p++ = (char) v->drivenummer + 'A';
*p++ = ':';
*p++ = '.';
*p = '\0';
} else {
strcpy(p, v->u.d.dospath);
p+= strlen(v->u.d.dospath);
while (maxcount-- && (NULL != (v = vec++)) && v->drivenummer != 0xff){
if (v->drivenummer < 26 || *(v->dospath)) {
if (p > path) *p++=';';
else p+=plen;
if (v->drivenummer < 26) {
*p++ = (char) v->drivenummer + 'A';
*p++ = ':';
if (*v->dospath) {
strcpy(p, v->dospath);
p+= strlen(v->dospath);
} else {
*p++='.';
*p ='\0';
}
} else {
strcpy(p, v->dospath);
p+= strlen(v->dospath);
}
}
}
return(putglobenv(path));