summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2010-11-01 17:28:33 +0000
committerLuke Bratch <l_bratch@yahoo.co.uk>2010-11-01 17:28:33 +0000
commita09e1cfb55d28b176f0f1703c4e8a9d1629f2d4b (patch)
treee7189ee149338d937af7b514f6203263e9aacdcc
parent28d75f5474dbb888d95c067e72d99fcada1cc73a (diff)
Make command matches be case insensitive
-rw-r--r--blasms.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/blasms.c b/blasms.c
index 05539f4..08abcac 100644
--- a/blasms.c
+++ b/blasms.c
@@ -214,6 +214,8 @@ int main(int argc, char *argv[]) {
char sms[500];
/* SMS command */
char smscommand[11];
+ /* SMS command in lowercase */
+ char smscommandlower[11];
/* Command to execute */
char systemcmd[1000];
/* Dynamic systemcmd for wildcard matches */
@@ -230,6 +232,8 @@ int main(int argc, char *argv[]) {
char line[1024];
/* Config file command */
char configcmd[11];
+ /* Config file command in lowercase */
+ char configcmdlower[11];
/* strchr pointer */
char *strchrp;
/* Command match / telnum set */
@@ -341,8 +345,11 @@ int main(int argc, char *argv[]) {
/* If it does end here, copy it to smscommand */
strxfrm(smscommand, sms, offset);
smscommand[offset] = '\0';
+ /* Convert commands to lowercase for comparison */
+ strtolower(smscommandlower, smscommand);
+ strtolower(configcmdlower, configcmd);
/* If the commands are the same, stop reading the file */
- if (!strcmp(smscommand, configcmd)) {
+ if (!strcmp(smscommandlower, configcmdlower)) {
match = 1;
break;
}