+ if (additional_extensions)
+ {
+ size_t slen=strlen(additional_extensions);
+ char buf[slen+1];
+ char *tmp=0, *cmds = buf;
+ memcpy(buf, additional_extensions, slen+1);
+
+ // strip spaces at beginning
+ while(cmds[0] == ' ')
+ {
+ ++cmds;
+ --slen;
+ }
+
+ // strip spaces at the end
+ while(slen && cmds[slen-1] == ' ')
+ {
+ cmds[slen-1] = 0;
+ --slen;
+ }
+
+ if (slen)
+ {
+ if (*cmds)
+ {
+ int id;
+ char buf2[16];
+ while(1)
+ {
+ tmp = strchr(cmds, ' ');
+ if (tmp)
+ *tmp = 0;
+ if (strstr(cmds, "0x"))
+ {
+ if (sscanf(cmds, "0x%x:%s", &id, buf2) == 2)
+ m_additional_extensions[id].push_back(buf2);
+ else
+ eDebug("parse additional_extension (%s) failed", cmds);
+ }
+ else
+ {
+ if (sscanf(cmds, "%d:%s", &id, buf2) == 2)
+ m_additional_extensions[id].push_back(buf2);
+ else
+ eDebug("parse additional_extension (%s) failed", cmds);
+ }
+ if (!tmp)
+ break;
+ cmds = tmp+1;
+ while (*cmds && *cmds == ' ')
+ ++cmds;
+ }
+ }
+ }
+ }