Diff for /np2/generic/hostdrvs.c between versions 1.1 and 1.2

version 1.1, 2004/01/09 04:36:02 version 1.2, 2004/01/09 07:27:15
Line 163  static char *dospath2fcb(char *fcbname,  Line 163  static char *dospath2fcb(char *fcbname, 
   
 BOOL hostdrvs_getrealpath(HDRVPATH *hdp, char *dospath) {  BOOL hostdrvs_getrealpath(HDRVPATH *hdp, char *dospath) {
   
         BOOL            ret;  
         char            path[MAX_PATH];          char            path[MAX_PATH];
         LISTARRAY       lst;          LISTARRAY       lst;
 const HDRVDIR   *di;  const HDRVDIR   *di;
         HDRVLST         hdl;          HDRVLST         hdl;
         char            fcbname[11];          char            fcbname[11];
   
         ret = SUCCESS;  
         file_cpyname(path, np2cfg.hdrvroot, sizeof(path));          file_cpyname(path, np2cfg.hdrvroot, sizeof(path));
         lst = NULL;          lst = NULL;
         di = &hddroot;          di = &hddroot;
Line 194  const HDRVDIR  *di; Line 192  const HDRVDIR  *di;
                 file_catname(path, hdl->realname, sizeof(path));                  file_catname(path, hdl->realname, sizeof(path));
                 di = &hdl->di;                  di = &hdl->di;
         }          }
         if (hdl) {          if (hdp) {
                 CopyMemory(&hdp->di, di, sizeof(HDRVDIR));                  CopyMemory(&hdp->di, di, sizeof(HDRVDIR));
                 file_cpyname(hdp->path, path, sizeof(hdp->path));                  file_cpyname(hdp->path, path, sizeof(hdp->path));
         }          }
Line 206  hdsgrp_err: Line 204  hdsgrp_err:
         return(FAILURE);          return(FAILURE);
 }  }
   
   BOOL hostdrvs_newrealpath(HDRVPATH *hdp, char *dospath) {
   
           char            path[MAX_PATH];
           LISTARRAY       lst;
           HDRVLST         hdl;
           char            fcbname[11];
           char            dosname[16];
           UINT            i;
           char            *p;
   
           file_cpyname(path, np2cfg.hdrvroot, sizeof(path));
           lst = NULL;
           if (dospath[0] != '\\') {
                   goto hdsgrp_err;
           }
           while(1) {
                   file_setseparator(path, sizeof(path));
                   dospath++;
                   if (dospath[0] == '\0') {
                           goto hdsgrp_err;
                   }
                   dospath = dospath2fcb(fcbname, dospath);
                   if (dospath[0] != '\\') {
                           break;
                   }
                   listarray_destroy(lst);
                   lst = hostdrvs_getpathlist(path);
                   hdl = (HDRVLST)listarray_enum(lst, hddsea, fcbname);
                   if ((hdl == NULL) || (!(hdl->di.attr & 0x10))) {
                           goto hdsgrp_err;
                   }
                   file_catname(path, hdl->realname, sizeof(path));
           }
           if (dospath[0] != '\0') {
                   goto hdsgrp_err;
           }
           listarray_destroy(lst);
           lst = hostdrvs_getpathlist(path);
           hdl = (HDRVLST)listarray_enum(lst, hddsea, fcbname);
           if (hdl != NULL) {
                   file_catname(path, hdl->realname, sizeof(path));
                   if (hdp) {
                           CopyMemory(&hdp->di, &hdl->di, sizeof(HDRVDIR));
                           file_cpyname(hdp->path, path, sizeof(hdp->path));
                   }
           }
           else {
                   p = dosname;
                   for (i=0; (i<8) && (fcbname[i] != ' '); i++) {
                           *p++ = fcbname[i];
                   }
                   if (fcbname[8] != ' ') {
                           *p++ = '.';
                           for (i=8; (i<11) && (fcbname[i] != ' '); i++) {
                                   *p++ = fcbname[i];
                           }
                   }
                   *p = '\0';
                   file_catname(path, dosname, sizeof(path));
                   if (hdp) {
                           CopyMemory(hdp->di.fcbname, fcbname, 11);
                           hdp->di.size = 0;
                           hdp->di.attr = 0;
                           file_cpyname(hdp->path, path, sizeof(hdp->path));
                   }
           }
           listarray_destroy(lst);
           return(SUCCESS);
   
   hdsgrp_err:
           listarray_destroy(lst);
           return(FAILURE);
   }
   
   
 // ----  // ----
   

Removed from v.1.1  
changed lines
  Added in v.1.2


RetroPC.NET-CVS <cvs@retropc.net>