| 532 | } |
| 533 | |
| 534 | static void writeString(FILE *stream, int indent, const char *name, const char *defaultString, char *string) { |
| 535 | char *string_tmp; |
| 536 | |
| 537 | if(!string) return; |
| 538 | if(defaultString && strcmp(string, defaultString) == 0) return; |
| 539 | writeIndent(stream, ++indent); |
| 540 | if(name) fprintf(stream, "%s ", name); |
| 541 | if ( (strchr(string, '\'') == NULL) && (strchr(string, '\"') == NULL)) |
| 542 | fprintf(stream, "\"%s\"\n", string); |
| 543 | else if ( (strchr(string, '\"') != NULL) && (strchr(string, '\'') == NULL)) |
| 544 | fprintf(stream, "'%s'\n", string); |
| 545 | else if ( (strchr(string, '\'') != NULL) && (strchr(string, '\"') == NULL)) |
| 546 | fprintf(stream, "\"%s\"\n", string); |
| 547 | else { |
| 548 | string_tmp = msStringEscape(string); |
| 549 | fprintf(stream, "\"%s\"\n", string_tmp); |
| 550 | free(string_tmp); |
| 551 | } |
| 552 | } |
| 553 | |
| 554 | static void writeNumberOrString(FILE *stream, int indent, const char *name, double defaultNumber, double number, char *string) { |
| 555 | if(string) |
no test coverage detected