comparison src/readpst.c @ 380:1e1970f93f94 stable-0-6-72

allow all 7 days in bydays recurring appointment, update for fedora python packaging
author Carl Byington <carl@five-ten-sg.com>
date Wed, 01 Aug 2018 08:15:34 -0700
parents 0ccc746c8079
children 5c0ce43c7532
comparison
equal deleted inserted replaced
379:bbd198da4033 380:1e1970f93f94
1158 char *quote_string(char *inp) { 1158 char *quote_string(char *inp) {
1159 int i = 0; 1159 int i = 0;
1160 int count = 0; 1160 int count = 0;
1161 char *curr = inp; 1161 char *curr = inp;
1162 while (*curr) { 1162 while (*curr) {
1163 *curr++;
1164 if (*curr == '\"' || *curr == '\\') { 1163 if (*curr == '\"' || *curr == '\\') {
1165 count++; 1164 count++;
1166 } 1165 }
1166 curr++;
1167 i++; 1167 i++;
1168 } 1168 }
1169 char *res = malloc(i + count + 1); 1169 char *res = malloc(i + count + 1);
1170 char *curr_in = inp; 1170 char *curr_in = inp;
1171 char *curr_out = res; 1171 char *curr_out = res;
2133 if (rdata->bydaymask) { 2133 if (rdata->bydaymask) {
2134 char byday[40]; 2134 char byday[40];
2135 int empty = 1; 2135 int empty = 1;
2136 int i=0; 2136 int i=0;
2137 memset(byday, 0, sizeof(byday)); 2137 memset(byday, 0, sizeof(byday));
2138 for (i=0; i<6; i++) { 2138 for (i=0; i<7; i++) {
2139 int bit = 1 << i; 2139 int bit = 1 << i;
2140 if (bit & rdata->bydaymask) { 2140 if (bit & rdata->bydaymask) {
2141 char temp[40]; 2141 char temp[40];
2142 snprintf(temp, sizeof(temp), "%s%s%s", byday, (empty) ? ";BYDAY=" : ";", days[i]); 2142 snprintf(temp, sizeof(temp), "%s%s%s", byday, (empty) ? ";BYDAY=" : ";", days[i]);
2143 strcpy(byday, temp); 2143 strcpy(byday, temp);