summaryrefslogtreecommitdiff
path: root/blasms.c
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2010-10-29 21:44:19 +0100
committerLuke Bratch <l_bratch@yahoo.co.uk>2010-10-29 21:44:19 +0100
commitb857cfb83f2b3eaae8854a9f641fbcb12be36d1f (patch)
tree9181d908f6addbe124eaf84a5c282d8c4b028561 /blasms.c
parent8fea91ecaada25df855b1ed484613aef4664d284 (diff)
Fix multiple %P macros (name to number lookups)
Diffstat (limited to 'blasms.c')
-rw-r--r--blasms.c8
1 files 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;
}