From b857cfb83f2b3eaae8854a9f641fbcb12be36d1f Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Fri, 29 Oct 2010 21:44:19 +0100 Subject: Fix multiple %P macros (name to number lookups) --- blasms.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/blasms.c b/blasms.c index 2a70b25..3c360e0 100644 --- a/blasms.c +++ b/blasms.c @@ -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; } -- cgit v1.2.3