summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/gsm/files/024_sms-text-in-bracket.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/gsm/files/024_sms-text-in-bracket.patch')
-rw-r--r--meta/recipes-connectivity/gsm/files/024_sms-text-in-bracket.patch72
1 files changed, 0 insertions, 72 deletions
diff --git a/meta/recipes-connectivity/gsm/files/024_sms-text-in-bracket.patch b/meta/recipes-connectivity/gsm/files/024_sms-text-in-bracket.patch
deleted file mode 100644
index 3aa13df01c..0000000000
--- a/meta/recipes-connectivity/gsm/files/024_sms-text-in-bracket.patch
+++ /dev/null
@@ -1,72 +0,0 @@
1http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=834
2
3From: Kristian Mueller <kristian@mput.de>
4Subject: [PATCH] libgsmd-tool does not allow sms with more than one word
5
6libgsmd-tool only allows for command strings without spaces.
7SMS messages with more than one word will be parsed as multible commands.
8The patch introduces SMS message text in bracket and fixes a NULL pointer
9reference on mailformed "ss" commands.
10
11Signed-off-by: Jim Huang <jserv@openmoko.org>
12
13Upstream-Status: Inappropriate [not used]
14---
15 src/util/shell.c | 32 ++++++++++++++++++++++++++------
16 1 file changed, 26 insertions(+), 6 deletions(-)
17
18Index: gsm/src/util/shell.c
19===================================================================
20--- gsm.orig/src/util/shell.c 2007-08-31 16:15:30.000000000 +0800
21+++ gsm/src/util/shell.c 2007-09-17 23:35:31.000000000 +0800
22@@ -389,7 +389,7 @@
23 "\tsd\tSMS Delete (sd=index,delflg)\n"
24 "\tsl\tSMS List (sl=stat)\n"
25 "\tsr\tSMS Read (sr=index)\n"
26- "\tss\tSMS Send (ss=number,text)\n"
27+ "\tss\tSMS Send (ss=number,text|[\"text\"])\n"
28 "\tsw\tSMS Write (sw=stat,number,text)\n"
29 "\tsm\tSMS Storage stats\n"
30 "\tsM\tSMS Set preferred storage (sM=mem1,mem2,mem3)\n"
31@@ -612,16 +612,36 @@
32
33 lgsm_sms_read(lgsmh, atoi(ptr+1));
34 } else if ( !strncmp(buf, "ss", 2)) {
35- printf("Send SMS\n");
36 struct lgsm_sms sms;
37
38 ptr = strchr(buf, '=');
39 fcomma = strchr(buf, ',');
40- strncpy(sms.addr, ptr+1, fcomma-ptr-1);
41- sms.addr[fcomma-ptr-1] = '\0';
42- packing_7bit_character(fcomma+1, &sms);
43+ if (!ptr || !fcomma) {
44+ printf("Wrong command format\n");
45+ } else {
46+ strncpy(sms.addr, ptr+1, fcomma-ptr-1);
47+ sms.addr[fcomma-ptr-1] = '\0';
48+
49+ /* todo define \" to allow " in text */
50+ if (fcomma[1] == '"' &&
51+ !strchr(fcomma+2, '"')) {
52+ /* read until closing '"' */
53+ rc = fscanf(stdin, "%[^\"]\"",
54+ fcomma+strlen(fcomma));
55+ if (rc == EOF) {
56+ printf("EOF\n");
57+ return -1;
58+ }
59+ /* remove brackets */
60+ fcomma++;
61+ fcomma[strlen(fcomma)] = '\0';
62+ }
63+
64+ printf("Send SMS\n");
65+ packing_7bit_character(fcomma+1, &sms);
66
67- lgsm_sms_send(lgsmh, &sms);
68+ lgsm_sms_send(lgsmh, &sms);
69+ }
70 } else if ( !strncmp(buf, "sw", 2)) {
71 printf("Write SMS\n");
72 struct lgsm_sms_write sms_write;