diff options
author | Andrés <andmarti@gmail.com> | 2021-03-26 09:55:15 -0300 |
---|---|---|
committer | Andrés <andmarti@gmail.com> | 2021-03-26 09:55:15 -0300 |
commit | 299fd32abd6b358c86e8368b6f397f3a628da2a8 (patch) | |
tree | 86a886657459bec593b7d7d4289f97a6663f13b9 | |
parent | db8a877df355648ab37b3ebcc9060a70dc97211c (diff) |
work on issue #457
-rw-r--r-- | src/cmds.c | 2 | ||||
-rw-r--r-- | src/file.c | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -1633,7 +1633,7 @@ struct ent * vert_middle() { */ struct ent * go_end() { - int r = currow, c = curcol; + int r = 0, c = 0; int raux = r, caux = c; register struct ent *p; do { @@ -1434,6 +1434,9 @@ void export_delim(char * fname, char coldelim, int r0, int c0, int rn, int cn, i register struct ent ** pp; int pid; + // to prevent empty lines at the end of the file + struct ent * ent = go_end(); + if (rn > ent->row) rn = ent->row; if (verbose) sc_info("Writing file \"%s\"...", fname); |