Subversion Repositories SvarDOS

Rev

Rev 989 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 989 Rev 1043
Line 46... Line 46...
46
  if (lookup_cmd(buff, linkname, realdirname, &ext) != 0) {
46
  if (lookup_cmd(buff, linkname, realdirname, &ext) != 0) {
47
    nls_outputnl(29,4); /* "No matching executable found in given path." */
47
    nls_outputnl(29,4); /* "No matching executable found in given path." */
48
    return(CMD_FAIL);
48
    return(CMD_FAIL);
49
  }
49
  }
50
 
50
 
51
  /* open DOSDIR\CFG\LINKS.DB and write realdirname to */
51
  /* compute the filename of the link file */
52
  if (link_computefname(buff, linkname, env_seg) != 0) return(CMD_FAIL);
52
  if (link_computefname(buff, linkname, env_seg) != 0) return(CMD_FAIL);
53
 
53
 
54
  realdirnamelen = strlen(realdirname);
54
  realdirnamelen = strlen(realdirname);
55
 
55
 
56
  /* open file *only if it does not exist yet* and write realdirname to it */
56
  /* open file *only if it does not exist yet* and write realdirname to it */
Line 157... Line 157...
157
    }
157
    }
158
  } else {
158
  } else {
159
    linkname = "*";
159
    linkname = "*";
160
  }
160
  }
161
 
161
 
162
  /* fetch %DOSDIR% */
-
 
163
  pathlen = env_lookup_valcopy(buff, 128, env_seg, "DOSDIR");
-
 
164
  if (pathlen == 0) {
-
 
165
    nls_outputnl(29,5); /* "%DOSDIR% not defined" */
-
 
166
    return(CMD_FAIL);
-
 
167
  }
-
 
168
 
-
 
169
  /* prep DOSDIR\LINKS\pattern */
162
  /* prep DOSDIR\LINKS\pattern */
170
  if (buff[pathlen - 1] == '\\') pathlen--;
163
  if (link_computefname(buff, linkname, env_seg) != 0) return(CMD_FAIL);
-
 
164
 
171
  pathlen += sprintf(buff + pathlen, "\\LINKS\\");
165
  /* set pathlen to end of path (char after last backslash) */
-
 
166
  pathlen = 0;
172
  sprintf(buff + pathlen, "%s.LNK", linkname);
167
  for (i = 0; buff[i] != 0; i++) if (buff[i] == '\\') pathlen = i + 1;
173
 
168
 
174
  if (findfirst(dta, buff, DOS_ATTR_RO | DOS_ATTR_ARC) != 0) return(CMD_OK);
169
  if (findfirst(dta, buff, DOS_ATTR_RO | DOS_ATTR_ARC) != 0) return(CMD_OK);
175
 
170
 
176
  do {
171
  do {
177
    /* print link file name (but trim ".lnk") */
172
    /* print link file name (but trim ".lnk") */