[asterisk-commits] tilghman: branch 1.6.2 r214074 - in /branches/1.6.2: ./ main/say.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Aug 25 14:42:53 CDT 2009
Author: tilghman
Date: Tue Aug 25 14:42:49 2009
New Revision: 214074
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214074
Log:
Merged revisions 214071 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r214071 | tilghman | 2009-08-25 14:32:48 -0500 (Tue, 25 Aug 2009) | 17 lines
Merged revisions 214068-214069 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r214068 | tilghman | 2009-08-25 14:26:50 -0500 (Tue, 25 Aug 2009) | 6 lines
Fix pronunciation of German dates.
(closes issue #15273)
Reported by: Benjamin Kluck
Patches:
say_c.patch uploaded by Benjamin Kluck (license 803)
........
r214069 | tilghman | 2009-08-25 14:28:42 -0500 (Tue, 25 Aug 2009) | 2 lines
I should always compile before committing...
........
................
Modified:
branches/1.6.2/ (props changed)
branches/1.6.2/main/say.c
Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.2/main/say.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/main/say.c?view=diff&rev=214074&r1=214073&r2=214074
==============================================================================
--- branches/1.6.2/main/say.c (original)
+++ branches/1.6.2/main/say.c Tue Aug 25 14:42:49 2009
@@ -3717,6 +3717,12 @@
return res;
}
+static char next_item(const char *format)
+{
+ const char *next = ast_skip_blanks(format);
+ return *next;
+}
+
/* Danish syntax */
int ast_say_date_with_format_da(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
@@ -3811,14 +3817,14 @@
/* FALLTRHU */
case 'k':
/* 24-Hour */
- res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL);
+ res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL);
break;
case 'M':
/* Minute */
- if (tm.tm_min > 0 || format[offset+ 1 ] == 'S' ) { /* zero 'digits/0' only if seconds follow (kind of a hack) */
- res = ast_say_number(chan, tm.tm_min, ints, lang, "f");
- }
- if ( !res && format[offset + 1] == 'S' ) { /* minutes only if seconds follow (kind of a hack) */
+ if (tm.tm_min > 0 || next_item(&format[offset + 1]) == 'S') { /* zero 'digits/0' only if seconds follow */
+ res = ast_say_number(chan, tm.tm_min, ints, lang, "f");
+ }
+ if (!res && next_item(&format[offset + 1]) == 'S') { /* minutes only if seconds follow */
if (tm.tm_min == 1) {
res = wait_file(chan, ints, "digits/minute", lang);
} else {
@@ -4015,10 +4021,13 @@
break;
case 'M':
/* Minute */
- if (tm.tm_min > 0 || format[offset+ 1 ] == 'S' ) { /* zero 'digits/0' only if seconds follow (kind of a hack) */
- res = ast_say_number(chan, tm.tm_min, ints, lang, "f");
- }
- if ( !res && format[offset + 1] == 'S' ) { /* minutes only if seconds follow (kind of a hack) */
+ if (next_item(&format[offset + 1]) == 'S') { /* zero 'digits/0' only if seconds follow */
+ res = ast_say_number(chan, tm.tm_min, ints, lang, "f"); /* female only if we say digits/minutes */
+ } else if (tm.tm_min > 0) {
+ res = ast_say_number(chan, tm.tm_min, ints, lang, (char *) NULL);
+ }
+
+ if (!res && next_item(&format[offset + 1]) == 'S') { /* minutes only if seconds follow */
if (tm.tm_min == 1) {
res = wait_file(chan, ints, "digits/minute", lang);
} else {
@@ -4096,7 +4105,7 @@
if (!res) {
res = ast_say_number(chan, tm.tm_sec, ints, lang, "f");
if (!res) {
- res = wait_file(chan, ints, "digits/seconds", lang);
+ res = wait_file(chan, ints, tm.tm_sec == 1 ? "digits/second" : "digits/seconds", lang);
}
}
break;
More information about the asterisk-commits
mailing list