Commit ae18d8d6 authored by paul@ice.snake.net's avatar paul@ice.snake.net

Patch for #3068: [Prompt without seconds when set from INI file].

(Fix hours/seconds always to display with two digits.)
parent 91370d96
......@@ -2676,6 +2676,8 @@ static const char* construct_prompt()
processed_prompt.append(' ');
break;
case 'R':
if (t->tm_hour < 10)
processed_prompt.append('0');
add_int_to_prompt(t->tm_hour);
break;
case 'r':
......@@ -2683,6 +2685,8 @@ static const char* construct_prompt()
getHour = t->tm_hour % 12;
if (getHour == 0)
getHour=12;
if (getHour < 10)
processed_prompt.append('0');
add_int_to_prompt(getHour);
break;
case 'm':
......@@ -2708,6 +2712,8 @@ static const char* construct_prompt()
processed_prompt.append(strtok(dateTime,"\n"));
break;
case 's':
if (t->tm_sec < 10)
processed_prompt.append('0');
add_int_to_prompt(t->tm_sec);
break;
case 'w':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment