aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2018-04-13 23:03:45 +0200
committerKristian Evers <kristianevers@gmail.com>2018-04-13 23:28:42 +0200
commit97a9bef9b6d78bcfc4cad49004aadc1c181369d5 (patch)
tree56897aaa24d027b5b7482c5f62d07f84f31ca6a2 /src
parentc3e346b7b61bd18b30de9f09ad0b1b507210ef5f (diff)
parenta023410e98ae879567963fb04fbd6e43ec67a6ae (diff)
downloadPROJ-97a9bef9b6d78bcfc4cad49004aadc1c181369d5.tar.gz
PROJ-97a9bef9b6d78bcfc4cad49004aadc1c181369d5.zip
Merge branch 'master' into logging_with_new_api
Diffstat (limited to 'src')
-rw-r--r--src/cct.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/cct.c b/src/cct.c
index c3d94ed2..956f91b3 100644
--- a/src/cct.c
+++ b/src/cct.c
@@ -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));