File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 2525
2626#define MDP_VER_MAJOR 1
2727#define MDP_VER_MINOR 0
28- #define MDP_VER_REVISION 16
28+ #define MDP_VER_REVISION 17
2929
3030#endif // !defined( MAIN_H )
Original file line number Diff line number Diff line change @@ -119,13 +119,14 @@ deck_t *markdown_load(FILE *input, int noexpand) {
119119 // initialize bits as empty line
120120 SET_BIT (bits , IS_EMPTY );
121121
122- while ((c = fgetwc (input )) != WEOF ) {
122+ for (;;) {
123+ c = fgetwc (input );
123124 if (ferror (input )) {
124125 fprintf (stderr , "markdown_load() failed to read input: %s\n" , strerror (errno ));
125126 exit (EXIT_FAILURE );
126127 }
127128
128- if (c == L'\n' ) {
129+ if (c == L'\n' || c == WEOF ) {
129130
130131 // markdown analyse
131132 prev = bits ;
@@ -230,6 +231,10 @@ deck_t *markdown_load(FILE *input, int noexpand) {
230231 // add char to line
231232 (text -> expand )(text , c );
232233 }
234+
235+ if (c == WEOF ) {
236+ break ;
237+ }
233238 }
234239 (text -> delete )(text );
235240
You can’t perform that action at this time.
0 commit comments