return FALSE;
p++;
- /* the spec mandates a format like %0[width]d
- But we also accept %d, because it doesn't hurt us
- */
- /* Following the %, if we have a number, it must start with 0 */
- if (g_ascii_isdigit (p[0]) && p[0] != '0')
+ /* the spec mandates a format like %0[width]d */
+ /* Following the %, we must have a 0 */
+ if (p[0] != '0')
return FALSE;
- /* Following the % must be a number, or any of d, x or u.
- * x and u are not part of the spec, but don't hurt us
+ /* Following the % must be a number starting with 0
*/
while (g_ascii_isdigit (*p))
p++;
- /* After any 0 and alphanumeric values, there must be
- * an d, x or u.
+ /* After any 0 and alphanumeric values, there must be a d.
*/
- if (p[0] != 'd' && p[0] != 'x' && p[0] != 'u')
+ if (p[0] != 'd')
return FALSE;
p++;
p++;
}
- /* After any 0 and alphanumeric values, there must be
- * an d, x or u. Otherwise validation would have failed
+ /* After any 0 and alphanumeric values, there must be a d.
+ * Otherwise validation would have failed
*/
- g_assert (p[0] == 'd' || p[0] == 'x' || p[0] == 'u');
+ g_assert (p[0] == 'd');
promoted_format =
g_strdup_printf ("%.*s" G_GINT64_MODIFIER "%s", (gint) (p - format),
{"TestMedia$Bandwidth$$$test", "TestMedia2500$test"}, /* Bandwidth identifier */
{"TestMedia$Time$", "TestMedia100"}, /* Time identifier */
{"TestMedia$Time", NULL}, /* Identifier not finished with $ */
- {"Time$Time%d$", "Time100"}, /* usage of %d (no width) */
+ {"Time$Time%d$", NULL}, /* usage of %d (no width) */
{"Time$Time%0d$", "Time100"}, /* usage of format smaller than number of digits */
{"Time$Time%01d$", "Time100"}, /* usage of format smaller than number of digits */
{"Time$Time%05d$", "Time00100"}, /* usage of format bigger than number of digits */
{"$Bandwidth1$", NULL}, /* incorrect identifier */
{"$Number1$", NULL}, /* incorrect identifier */
{"$RepresentationID%01d$", NULL}, /* incorrect format: RepresentationID does not support formatting */
- {"Time$Time%05u$", "Time00100"}, /* %u format */
- {"Time$Time%05x$", "Time00064"}, /* %x format */
- {"Time$Time%05utest$", "Time00100test"}, /* %u format followed by text */
- {"Time$Time%05xtest$", "Time00064test"}, /* %x format followed by text */
+ {"Time$Time%05u$", NULL}, /* %u format */
+ {"Time$Time%05x$", NULL}, /* %x format */
+ {"Time$Time%05utest$", NULL}, /* %u format followed by text */
+ {"Time$Time%05xtest$", NULL}, /* %x format followed by text */
{"Time$Time%05xtest%$", NULL}, /* second % character in format */
};