diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-04-13 19:41:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-13 19:41:48 +0200 |
| commit | a023410e98ae879567963fb04fbd6e43ec67a6ae (patch) | |
| tree | dfffd333683dd08030a000c2c952eccb6120927c | |
| parent | a372a17445018f12acd51f716f3cb5ba5d30e8f7 (diff) | |
| parent | be27d12a028d07ed656080004c949c0da7a6012e (diff) | |
| download | PROJ-a023410e98ae879567963fb04fbd6e43ec67a6ae.tar.gz PROJ-a023410e98ae879567963fb04fbd6e43ec67a6ae.zip | |
Merge pull request #933 from kbevers/cct-respect-comments
Always ignore out-commented lines in cct
| -rw-r--r-- | src/cct.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -271,6 +271,7 @@ int main(int argc, char **argv) { while (opt_input_loop (o, optargs_file_format_text)) { int err; void *ret = fgets (buf, 10000, o->input); + char *c = column (buf, 1); opt_eof_handler (o); if (0==ret) { fprintf (stderr, "Read error in record %d\n", (int) o->record_index); @@ -281,15 +282,14 @@ int main(int argc, char **argv) { skip_lines--; continue; } - if (HUGE_VAL==point.xyzt.x) { - char *c = column (buf, 1); - /* if it's a comment or blank line, we reflect it */ - if (c && ((*c=='\0') || (*c=='#'))) { - fprintf (fout, "%s\n", buf); - continue; - } + /* if it's a comment or blank line, we reflect it */ + if (c && ((*c=='\0') || (*c=='#'))) { + fprintf (fout, "%s", buf); + continue; + } + if (HUGE_VAL==point.xyzt.x) { /* otherwise, it must be a syntax error */ fprintf (fout, "# Record %d UNREADABLE: %s", (int) o->record_index, buf); if (verbose) |
