res = AST_TEST_FAIL;
}
+ /* + should be ignored and there should not be a leading & */
+ ast_str_set(&expr, 0, "${SAYFILES(+18005551212,digits)}");
+ ast_str_substitute_variables(&result, 0, NULL, ast_str_buffer(expr));
+ if (strcmp(ast_str_buffer(result), "digits/1&digits/8&digits/0&digits/0&digits/5&digits/5&digits/5&digits/1&digits/2&digits/1&digits/2") != 0) {
+ ast_test_status_update(test, "SAYFILES(+18005551212,digits) test failed ('%s')\n",
+ ast_str_buffer(result));
+ res = AST_TEST_FAIL;
+ }
+
ast_str_set(&expr, 0, "${SAYFILES(35,number)}");
ast_str_substitute_variables(&result, 0, NULL, ast_str_buffer(expr));
if (strcmp(ast_str_buffer(result), "digits/30&digits/5") != 0) {
}
if ((fn && ast_fileexists(fn, NULL, lang) > 0) ||
(snprintf(asciibuf + 13, sizeof(asciibuf) - 13, "%d", str[num]) > 0 && ast_fileexists(asciibuf, NULL, lang) > 0 && (fn = asciibuf))) {
- ast_str_append(&filenames, 0, (num == 0 ? "%s" : "&%s"), fn);
+ ast_str_append(&filenames, 0, "%s%s", ast_str_strlen(filenames) ? "&" : "", fn);
}
if (upper || lower) {
continue;
fn = fnbuf;
}
if (fn && ast_fileexists(fn, NULL, lang) > 0) {
- ast_str_append(&filenames, 0, (num == 0 ? "%s" : "&%s"), fn);
+ ast_str_append(&filenames, 0, "%s%s", ast_str_strlen(filenames) ? "&" : "", fn);
}
num++;
}
break;
}
if (fn && ast_fileexists(fn, NULL, lang) > 0) {
- ast_str_append(&filenames, 0, (num == 0 ? "%s" : "&%s"), fn);
+ ast_str_append(&filenames, 0, "%s%s", ast_str_strlen(filenames) ? "&" : "", fn);
}
num++;
}