- Timestamp:
- Dec 24, 2016, 12:56:11 AM (8 years ago)
- Location:
- branches/3.3/mondo/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/libmondo-fork.c
r3615 r3641 253 253 /*@ buffer ****************************************************** */ 254 254 char *callstr = NULL; 255 char incoming[MAX_STR_LEN * 2];255 char *incoming = NULL; 256 256 char *tmp1 = NULL; 257 char *tmp2 = NULL; 257 258 258 259 /*@ int ********************************************************* */ … … 307 308 fin = fopen(tmp1, "r"); 308 309 if (fin) { 309 for (q = fgets(incoming, MAX_STR_LEN, fin); !feof(fin) && (q != NULL); q = fgets(incoming, MAX_STR_LEN, fin)) { 310 p = incoming; 311 while (p && *p) { 312 if ((p = strchr(p, '%'))) { 313 memmove(p, p + 1, strlen(p) + 1); 314 p += 2; 315 } 316 } 317 strip_spaces(incoming); 310 for (mr_getline(incoming, fin); !feof(fin); mr_getline(incoming, fin)) { 311 // Removes % char 312 tmp2 = mr_stresc(incoming, "%", '\\', '\''); 313 mr_free(incoming); 314 incoming = tmp2; 315 316 // Remove spaces 317 tmp2 = mr_strip_spaces(incoming); 318 mr_free(incoming); 319 incoming = tmp2; 318 320 if ((res == 0 && log_if_success) || (res != 0 && log_if_failure)) { 319 321 log_msg(0, incoming); 320 322 } 323 mr_free(incoming); 321 324 } 322 325 paranoid_fclose(fin); -
branches/3.3/mondo/src/lib/mr_str.c
r3627 r3641 193 193 } 194 194 195 /* Subsitute the string token in the string in by the string subst */ 195 196 char *mr_str_substitute(const char *in, const char *token, const char *subst) { 196 197 … … 205 206 return(output); 206 207 } 207 // token found end string here for now208 // token found: end string here for now 208 209 *tmp = '\0'; 209 210
Note:
See TracChangeset
for help on using the changeset viewer.