Subversion Repositories SvarDOS

Rev

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

Rev 437 Rev 438
Line 102... Line 102...
102
}
102
}
103
 
103
 
104
 
104
 
105
static void buildprompt(char *s, unsigned short envseg) {
105
static void buildprompt(char *s, unsigned short envseg) {
106
  /* locate the prompt variable or use the default pattern */
106
  /* locate the prompt variable or use the default pattern */
107
  const char far *fmt = env_lookup(envseg, "PROMPT");
107
  const char far *fmt = env_lookup_val(envseg, "PROMPT");
108
  while ((fmt != NULL) && (*fmt != 0)) {
-
 
109
    fmt++;
-
 
110
    if (fmt[-1] == '=') break;
-
 
111
  }
-
 
112
  if ((fmt == NULL) || (*fmt == 0)) fmt = "$p$g"; /* fallback to default if empty */
108
  if ((fmt == NULL) || (*fmt == 0)) fmt = "$p$g"; /* fallback to default if empty */
113
  /* build the prompt string based on pattern */
109
  /* build the prompt string based on pattern */
114
  for (; *fmt != 0; fmt++) {
110
  for (; *fmt != 0; fmt++) {
115
    if (*fmt != '$') {
111
    if (*fmt != '$') {
116
      *s = *fmt;
112
      *s = *fmt;