diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-04-13 23:03:45 +0200 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2018-04-13 23:28:42 +0200 |
| commit | 97a9bef9b6d78bcfc4cad49004aadc1c181369d5 (patch) | |
| tree | 56897aaa24d027b5b7482c5f62d07f84f31ca6a2 /src | |
| parent | c3e346b7b61bd18b30de9f09ad0b1b507210ef5f (diff) | |
| parent | a023410e98ae879567963fb04fbd6e43ec67a6ae (diff) | |
| download | PROJ-97a9bef9b6d78bcfc4cad49004aadc1c181369d5.tar.gz PROJ-97a9bef9b6d78bcfc4cad49004aadc1c181369d5.zip | |
Merge branch 'master' into logging_with_new_api
Diffstat (limited to 'src')
| -rw-r--r-- | src/cct.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -217,6 +217,8 @@ int main(int argc, char **argv) { "s=skip-lines", 0}; + fout = stdout; + o = opt_parse (argc, argv, "hvI", "cozts", longflags, longkeys); if (0==o) return 0; @@ -316,6 +318,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) { print (PJ_LOG_ERROR, "Read error in record %d\n", (int) o->record_index); @@ -326,15 +329,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=='#'))) { - print (PJ_LOG_NONE, "%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 */ print (PJ_LOG_NONE, "# Record %d UNREADABLE: %s", (int) o->record_index, buf); print (PJ_LOG_ERROR, "%s: Could not parse file '%s' line %d\n", o->progname, opt_filename (o), opt_record (o)); |
