[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[5991] better support of Info files with CR-LF line endings
From: |
Gavin D. Smith |
Subject: |
[5991] better support of Info files with CR-LF line endings |
Date: |
Thu, 25 Dec 2014 18:02:59 +0000 |
Revision: 5991
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5991
Author: gavin
Date: 2014-12-25 18:02:58 +0000 (Thu, 25 Dec 2014)
Log Message:
-----------
better support of Info files with CR-LF line endings
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/info-utils.c
trunk/info/nodes.c
trunk/info/search.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2014-12-25 17:26:04 UTC (rev 5990)
+++ trunk/ChangeLog 2014-12-25 18:02:58 UTC (rev 5991)
@@ -1,3 +1,13 @@
+2014-12-25 Gavin Smith <address@hidden>
+
+ * info/search.c (find_node_separator, skip_node_separator):
+ Allow optional '\r' before '\n' after Ctrl-_ node separator.
+
+ * info/info-utils.c (parse_top_node_line),
+ * info/nodes.c (get_nodes_of_info_file),
+ * info/search.c (find_node_in_binding): Include '\r' in list of
+ terminating characters.
+
2013-12-25 Eli Zaretskii <address@hidden>
* info/man.c (get_manpage_from_formatter) <!PIPE_USE_FORK>:
Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c 2014-12-25 17:26:04 UTC (rev 5990)
+++ trunk/info/info-utils.c 2014-12-25 18:02:58 UTC (rev 5991)
@@ -1145,7 +1145,7 @@
/* Separate at commas or newlines, so it will work for
filenames including full stops. */
/* TODO: Account for "(dir)" and "(DIR)". */
- value_length = read_quoted_string (inptr, "\n\t,", 1, store_in);
+ value_length = read_quoted_string (inptr, "\n\r\t,", 1, store_in);
free (dummy); dummy = 0;
Modified: trunk/info/nodes.c
===================================================================
--- trunk/info/nodes.c 2014-12-25 17:26:04 UTC (rev 5990)
+++ trunk/info/nodes.c 2014-12-25 18:02:58 UTC (rev 5991)
@@ -221,7 +221,7 @@
/* Record nodename and nodestart. */
entry = info_create_node ();
- read_quoted_string (nodeline + start, ",\n\t", 0, &entry->nodename);
+ read_quoted_string (nodeline + start, ",\n\r\t", 0, &entry->nodename);
entry->nodestart = nodestart;
init_file_buffer_tag (file_buffer, entry);
Modified: trunk/info/search.c
===================================================================
--- trunk/info/search.c 2014-12-25 17:26:04 UTC (rev 5990)
+++ trunk/info/search.c 2014-12-25 18:02:58 UTC (rev 5991)
@@ -439,21 +439,28 @@
body = binding->buffer;
- /* A node is started by [^L]^_[^L]\n. That is to say, the C-l's are
- optional, but the DELETE and NEWLINE are not. This separator holds
+ /* A node is started by [^L]^_[^L][\r]\n. That is to say, the C-l's are
+ optional, but the US and NEWLINE are not. This separator holds
true for all separated elements in an Info file, including the tags
table (if present) and the indirect tags table (if present). */
for (i = binding->start; i < binding->end; i++)
/* Note that bytes are read in order from the buffer, so if at any
point a null byte is encountered signifying the end of the buffer,
no more bytes will be read past that point. */
- if ( (body[i] == INFO_FF && body[i + 1] == INFO_COOKIE
- && (body[i + 2] == '\n'
- || (body[i + 2] == INFO_FF && body[i + 3] == '\n')))
- || (body[i] == INFO_COOKIE
- && (body[i + 1] == '\n'
- || (body[i + 1] == INFO_FF && body[i + 2] == '\n'))))
- return i;
+
+ if (body[i] == INFO_COOKIE)
+ {
+ int j = i + 1;
+
+ if (body[j] == INFO_FF)
+ j++;
+ if (body[j] == '\r')
+ j++;
+
+ if (body[j] == '\n')
+ return i;
+ }
+
return -1;
}
@@ -475,6 +482,9 @@
if (body[i] == INFO_FF)
i++;
+ if (body[i] == '\r')
+ i++;
+
if (body[i++] != '\n')
return 0;
@@ -555,7 +565,7 @@
s.start += offset;
s.start += skip_whitespace (s.buffer + s.start);
nodename_start = s.buffer + s.start;
- read_quoted_string (nodename_start, "\n\t,", 0, &read_nodename);
+ read_quoted_string (nodename_start, "\n\r\t,", 0, &read_nodename);
if (!read_nodename)
return -1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [5991] better support of Info files with CR-LF line endings,
Gavin D. Smith <=