Subversion Repositories SvarDOS

Rev

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

Rev 371 Rev 372
Line 3... Line 3...
3
 *
3
 *
4
 * Changes the DOS command prompt.
4
 * Changes the DOS command prompt.
5
 *
5
 *
6
 */
6
 */
7
 
7
 
8
static int cmd_prompt(const struct cmd_funcparam *p) {
8
static int cmd_prompt(struct cmd_funcparam *p) {
9
  if ((p->argc == 1) && (imatch(p->argv[0], "/?"))) {
9
  if ((p->argc == 1) && (imatch(p->argv[0], "/?"))) {
10
    output("Changes the DOS command prompt.\r\n"
10
    output("Changes the DOS command prompt.\r\n"
11
           "\r\n"
11
           "\r\n"
12
           "PROMPT [new command prompt specification]\r\n"
12
           "PROMPT [new command prompt specification]\r\n"
13
           "\r\n");
13
           "\r\n");
Line 20... Line 20...
20
    return(-1);
20
    return(-1);
21
  }
21
  }
22
 
22
 
23
  /* otherwise set PROMPT to whatever is passed on command-line */
23
  /* otherwise set PROMPT to whatever is passed on command-line */
24
  {
24
  {
25
    char buff[256] = "PROMPT=";
-
 
26
    unsigned short i;
25
    unsigned short i;
-
 
26
    char *buff = p->BUFFER;
-
 
27
    strcpy(buff, "PROMPT=");
27
    for (i = 0;; i++) {
28
    for (i = 0;; i++) {
28
      buff[i + 7] = p->cmdline[p->argoffset + i];
29
      buff[i + 7] = p->cmdline[p->argoffset + i];
29
      if (buff[i + 7] == '\r') break;
30
      if (buff[i + 7] == '\r') break;
30
    }
31
    }
31
    buff[i + 7] = 0;
32
    buff[i + 7] = 0;