aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2018-04-13 19:41:48 +0200
committerGitHub <noreply@github.com>2018-04-13 19:41:48 +0200
commita023410e98ae879567963fb04fbd6e43ec67a6ae (patch)
treedfffd333683dd08030a000c2c952eccb6120927c
parenta372a17445018f12acd51f716f3cb5ba5d30e8f7 (diff)
parentbe27d12a028d07ed656080004c949c0da7a6012e (diff)
downloadPROJ-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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cct.c b/src/cct.c
index 2952f2b7..00fc2127 100644
--- a/src/cct.c
+++ b/src/cct.c
@@ -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)