summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>2001-11-14 18:36:27 +0000
committerDaniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>2001-11-14 18:36:27 +0000
commit4f242356a1bf9d18f5fc3adfa7b76a87ec25dc6e (patch)
treeec591e06214cb6fb40146f93ec4d704da8fcb4f7
parent36d635bb284bff4a11daae28ef0e861479be9478 (diff)
-
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4009 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--camlp4/etc/pr_o.ml4
-rw-r--r--camlp4/etc/pr_r.ml4
2 files changed, 6 insertions, 2 deletions
diff --git a/camlp4/etc/pr_o.ml b/camlp4/etc/pr_o.ml
index caa256983..ba28deb0f 100644
--- a/camlp4/etc/pr_o.ml
+++ b/camlp4/etc/pr_o.ml
@@ -1763,7 +1763,9 @@ value copy_source ic oc first bp ep =
;
value copy_to_end ic oc first bp =
- copy_source ic oc first bp (in_channel_length ic)
+ let ilen = in_channel_length ic in
+ if bp < ilen then copy_source ic oc first bp ilen
+ else output_string oc "\n"
;
value apply_printer printer ast =
diff --git a/camlp4/etc/pr_r.ml b/camlp4/etc/pr_r.ml
index 8b6f7bff1..89eddbc40 100644
--- a/camlp4/etc/pr_r.ml
+++ b/camlp4/etc/pr_r.ml
@@ -1591,7 +1591,9 @@ value copy_source ic oc first bp ep =
;
value copy_to_end ic oc first bp =
- copy_source ic oc first bp (in_channel_length ic)
+ let ilen = in_channel_length ic in
+ if bp < ilen then copy_source ic oc first bp ilen
+ else output_string oc "\n"
;
module Buff =