[hackers] [st] Using strtok_r for the string parsing. || Christoph Lohmann

From: <git_AT_suckless.org>
Date: Mon, 25 Feb 2013 13:39:00 +0100

commit 7cb0d95509d1b2837e4fa7d131f497800b20d22c
Author: Christoph Lohmann <20h_AT_r-36.net>
Date: Mon Feb 25 13:36:40 2013 +0100

    Using strtok_r for the string parsing.

diff --git a/st.c b/st.c
index 23c4caf..7ddce0c 100644
--- a/st.c
+++ b/st.c
_AT_@ -1300,8 +1300,10 @@ csiparse(void) {
         long int v;
 
         csiescseq.narg = 0;
- if(*p == '?')
- csiescseq.priv = 1, p++;
+ if(*p == '?') {
+ csiescseq.priv = 1;
+ p++;
+ }
 
         while(p < csiescseq.buf+csiescseq.len) {
                 np = NULL;
_AT_@ -1928,23 +1930,17 @@ strhandle(void) {
 
 void
 strparse(void) {
- /*
- * TODO: Implement parsing like for CSI when required.
- * Format: ESC type cmd ';' arg0 [';' argn] ESC \
- */
- int narg = 0;
- char *start = strescseq.buf, *end = start + strescseq.len;
- strescseq.args[0] = start;
- while(start < end && narg < LEN(strescseq.args)) {
- start = memchr(start, ';', end - start);
- if(!start)
- break;
- *start++ = '
Received on Mon Feb 25 2013 - 13:39:00 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 25 2013 - 13:48:09 CET