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() ...@@ -2676,6 +2676,8 @@ static const char* construct_prompt()
processed_prompt.append(' '); processed_prompt.append(' ');
break; break;
case 'R': case 'R':
if (t->tm_hour < 10)
processed_prompt.append('0');
add_int_to_prompt(t->tm_hour); add_int_to_prompt(t->tm_hour);
break; break;
case 'r': case 'r':
...@@ -2683,6 +2685,8 @@ static const char* construct_prompt() ...@@ -2683,6 +2685,8 @@ static const char* construct_prompt()
getHour = t->tm_hour % 12; getHour = t->tm_hour % 12;
if (getHour == 0) if (getHour == 0)
getHour=12; getHour=12;
if (getHour < 10)
processed_prompt.append('0');
add_int_to_prompt(getHour); add_int_to_prompt(getHour);
break; break;
case 'm': case 'm':
...@@ -2708,6 +2712,8 @@ static const char* construct_prompt() ...@@ -2708,6 +2712,8 @@ static const char* construct_prompt()
processed_prompt.append(strtok(dateTime,"\n")); processed_prompt.append(strtok(dateTime,"\n"));
break; break;
case 's': case 's':
if (t->tm_sec < 10)
processed_prompt.append('0');
add_int_to_prompt(t->tm_sec); add_int_to_prompt(t->tm_sec);
break; break;
case 'w': 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