summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}