diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2015-07-09 01:17:33 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2015-07-09 01:17:33 +0000 |
| commit | 94888109688fa73d31ce4268fd2d589d948dd9f8 (patch) | |
| tree | 69057df096af6759ecff73717a8b82d5ed4bdeab /fluid | |
| parent | 4cea3aee0c4153c7b7c2fc485b2e4ef37cbd3f19 (diff) | |
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
Diffstat (limited to 'fluid')
| -rw-r--r-- | fluid/file.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fluid/file.cxx b/fluid/file.cxx index f4cf18c1c..92ab8925a 100644 --- a/fluid/file.cxx +++ b/fluid/file.cxx @@ -87,11 +87,13 @@ void write_word(const char *w) { 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, ...) { va_list args; va_start(args, format); - if (needspace) fputc(' ',fout); + if (needspace && *format != '\n') fputc(' ',fout); vfprintf(fout, format, args); va_end(args); needspace = !isspace(format[strlen(format)-1] & 255); |
