diff options
Diffstat (limited to 'apps/talk.c')
-rw-r--r-- | apps/talk.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/talk.c b/apps/talk.c index 5fddf85986..8c0f1f3a07 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -1015,7 +1015,7 @@ int talk_number(long n, bool enqueue) | |||
1015 | 1015 | ||
1016 | /* Say time duration/interval. Input is time in seconds, | 1016 | /* Say time duration/interval. Input is time in seconds, |
1017 | say hours,minutes,seconds. */ | 1017 | say hours,minutes,seconds. */ |
1018 | static int talk_time_unit(long secs, bool exact, bool enqueue) | 1018 | static int talk_time_unit(long secs, bool enqueue) |
1019 | { | 1019 | { |
1020 | int hours, mins; | 1020 | int hours, mins; |
1021 | if (!enqueue) | 1021 | if (!enqueue) |
@@ -1026,11 +1026,9 @@ static int talk_time_unit(long secs, bool exact, bool enqueue) | |||
1026 | } | 1026 | } |
1027 | if((mins = secs/60)) { | 1027 | if((mins = secs/60)) { |
1028 | secs %= 60; | 1028 | secs %= 60; |
1029 | if(exact || !hours) | 1029 | talk_value(mins, UNIT_MIN, true); |
1030 | talk_value(mins, UNIT_MIN, true); | ||
1031 | else talk_number(mins, true); /* don't say "minutes" */ | ||
1032 | } | 1030 | } |
1033 | if((exact && secs) || (!hours && !mins)) | 1031 | if((secs) || (!hours && !mins)) |
1034 | talk_value(secs, UNIT_SEC, true); | 1032 | talk_value(secs, UNIT_SEC, true); |
1035 | else if(!hours && secs) | 1033 | else if(!hours && secs) |
1036 | talk_number(secs, true); | 1034 | talk_number(secs, true); |
@@ -1110,8 +1108,8 @@ int talk_value_decimal(long n, int unit, int decimals, bool enqueue) | |||
1110 | #endif | 1108 | #endif |
1111 | 1109 | ||
1112 | /* special case for time duration */ | 1110 | /* special case for time duration */ |
1113 | if (unit == UNIT_TIME || unit == UNIT_TIME_EXACT) | 1111 | if (unit == UNIT_TIME) |
1114 | return talk_time_unit(n, unit == UNIT_TIME_EXACT, enqueue); | 1112 | return talk_time_unit(n, enqueue); |
1115 | 1113 | ||
1116 | if (unit < 0 || unit >= UNIT_LAST) | 1114 | if (unit < 0 || unit >= UNIT_LAST) |
1117 | unit_id = -1; | 1115 | unit_id = -1; |