diff options
author | Luke Bratch <l_bratch@yahoo.co.uk> | 2010-10-29 21:44:19 +0100 |
---|---|---|
committer | Luke Bratch <l_bratch@yahoo.co.uk> | 2010-10-29 21:44:19 +0100 |
commit | b857cfb83f2b3eaae8854a9f641fbcb12be36d1f (patch) | |
tree | 9181d908f6addbe124eaf84a5c282d8c4b028561 | |
parent | 8fea91ecaada25df855b1ed484613aef4664d284 (diff) |
Fix multiple %P macros (name to number lookups)
-rw-r--r-- | blasms.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -143,7 +143,7 @@ int main(int argc, char *argv[]) { char configcmd[8]; /* strchr pointer */ char *strchrp; - /* Command match */ + /* Command match / telnum set */ short int match = 0; if (argc != 3 || !strcmp(argv[argc - 1], "--help")) { @@ -241,6 +241,7 @@ int main(int argc, char *argv[]) { } //printf("Command: %s\n", systemcmd); + match = 0; for (i = 0; i < strlen(systemcmd); i++) { if (systemcmd[i] == '%') { @@ -259,7 +260,10 @@ int main(int argc, char *argv[]) { replacestr(systemcmd, i, sms + offset + 1); break; case 'P': - settelnum(telnum, sms, &offset); + if (!match) { + settelnum(telnum, sms, &offset); + } + match = 1; replacestr(systemcmd, i, telnum); break; } |