Fix trailing white space in fluid .fl files (STR #3239).

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10782 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser
2015-07-09 01:17:33 +00:00
parent 4cea3aee0c
commit 9488810968
2 changed files with 6 additions and 2 deletions
+2
View File
@@ -39,6 +39,8 @@ CHANGES IN FLTK 1.3.4 RELEASED: ??? ?? ????
Bug fixes Bug fixes
- fluid doesn't output trailing white space in .fl files after
some statements anymore (STR #3239).
- Several box types were not drawn correctly when deactivated. - Several box types were not drawn correctly when deactivated.
The background color for deactivated widgets is now correct: The background color for deactivated widgets is now correct:
fl_inactive(color()) (STR #2907). fl_inactive(color()) (STR #2907).
+4 -2
View File
@@ -87,11 +87,13 @@ void write_word(const char *w) {
putc('}', fout); putc('}', fout);
} }
// write an arbitrary formatted word, or a comment, etc: // write an arbitrary formatted word, or a comment, etc.
// if needspace is set, then one space is written before the string
// unless the format starts with a newline character ('\n'):
void write_string(const char *format, ...) { void write_string(const char *format, ...) {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
if (needspace) fputc(' ',fout); if (needspace && *format != '\n') fputc(' ',fout);
vfprintf(fout, format, args); vfprintf(fout, format, args);
va_end(args); va_end(args);
needspace = !isspace(format[strlen(format)-1] & 255); needspace = !isspace(format[strlen(format)-1] & 255);