Subversion Repositories SvarDOS

Rev

Rev 373 | Rev 397 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 373 Rev 387
Line 5... Line 5...
5
 */
5
 */
6
 
6
 
7
static int cmd_path(struct cmd_funcparam *p) {
7
static int cmd_path(struct cmd_funcparam *p) {
8
  char *buff = p->BUFFER;
8
  char *buff = p->BUFFER;
9
 
9
 
-
 
10
  /* help screen (/?) */
-
 
11
  if (cmd_ishlp(p)) {
-
 
12
    output("Displays or sets a search path for executable files.\r\n"
-
 
13
           "\r\n"
-
 
14
           "PATH [[drive:]path[;...]]\r\n"
-
 
15
           "PATH ;\r\n"
-
 
16
           "\r\n"
-
 
17
           "Type PATH ; to clear all search-path settings and direct DOS to search\r\n"
-
 
18
           "only in the current directory.\r\n"
-
 
19
           "\r\n"
-
 
20
           "Type PATH without parameters to display the current path.\r\n");
-
 
21
    return(-1);
-
 
22
  }
-
 
23
 
10
  /* no parameter - display current path */
24
  /* no parameter - display current path */
11
  if (p->argc == 0) {
25
  if (p->argc == 0) {
12
    char far *curpath = env_lookup(p->env_seg, "PATH");
26
    char far *curpath = env_lookup(p->env_seg, "PATH");
13
    if (curpath == NULL) {
27
    if (curpath == NULL) {
14
      outputnl("No Path");
28
      outputnl("No Path");
Line 29... Line 43...
29
    return(-1);
43
    return(-1);
30
  }
44
  }
31
 
45
 
32
  /* IF HERE: THERE IS EXACTLY 1 ARGUMENT (argc == 1) */
46
  /* IF HERE: THERE IS EXACTLY 1 ARGUMENT (argc == 1) */
33
 
47
 
34
  /* help screen (/?) */
-
 
35
  if (imatch(p->argv[0], "/?")) {
-
 
36
    output("Displays or sets a search path for executable files.\r\n"
-
 
37
           "\r\n"
-
 
38
           "PATH [[drive:]path[;...]]\r\n"
-
 
39
           "PATH ;\r\n"
-
 
40
           "\r\n"
-
 
41
           "Type PATH ; to clear all search-path settings and direct DOS to search\r\n"
-
 
42
           "only in the current directory.\r\n"
-
 
43
           "\r\n"
-
 
44
           "Type PATH without parameters to display the current path.\r\n");
-
 
45
    return(-1);
-
 
46
  }
-
 
47
 
-
 
48
  /* reset the PATH string (PATH ;) */
48
  /* reset the PATH string (PATH ;) */
49
  if (imatch(p->argv[0], ";")) {
49
  if (imatch(p->argv[0], ";")) {
50
    env_dropvar(p->env_seg, "PATH");
50
    env_dropvar(p->env_seg, "PATH");
51
    return(-1);
51
    return(-1);
52
  }
52
  }