Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 154039 Details for
Bug 220695
sys-apps/texinfo-4.12: install-info inserts spurious whitespace
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch against texinfo-4.12
texinfo-4.12-install-info.patch (text/plain), 3.95 KB, created by
Ulrich Müller
on 2008-05-23 07:49:13 UTC
(
hide
)
Description:
patch against texinfo-4.12
Filename:
MIME Type:
Creator:
Ulrich Müller
Created:
2008-05-23 07:49:13 UTC
Size:
3.95 KB
patch
obsolete
>--- texinfo-4.12-orig/install-info/install-info.c 2008-04-19 19:03:14.000000000 +0200 >+++ texinfo-4.12/install-info/install-info.c 2008-05-23 09:31:37.000000000 +0200 >@@ -1449,15 +1449,22 @@ > { > char *endptr; > >- /* on the first line, the description starts after the first period. */ >+ /* on the first line, the description starts after the first ". "; >+ that's a period and space -- our heuristic to handle item names like >+ "config.status", and node names like "config.status Invocation". >+ Also accept period-tab and period-newline. */ > char *ptr = strchr (entry, '.'); >+ while (ptr && ptr[1] != ' ' && ptr[1] != '\t' && ptr[1] != '\n') { >+ ptr = strchr (ptr + 1, '.'); >+ } >+ > /* Maybe there's no period, and no description */ > if (!ptr) > { > size_t length = strlen (entry); > if (length == 0) > return; >- *name = strdup (ptr); >+ *name = strdup (entry); > *name_len = length + 1; > return; > } >@@ -1598,14 +1605,14 @@ > /* Insert NAME into the right place in ENTRY->TEXT. */ > char *info, *rest, *text; > size_t name_len = strlen (name); >- char *ptr = strstr (entry->text, ": ()."); >+ char *ptr = strstr (entry->text, ": (). "); > if (!ptr) > return; > ptr[0] = '\0'; >- rest = ptr += sizeof (": ()."); >+ rest = ptr += strlen (": (). "); > >- info = xmalloc (name_len + 6); >- snprintf (info, name_len + 6, ": (%s).", name); >+ info = xmalloc (name_len + 7); >+ snprintf (info, name_len + 7, ": (%s). ", name); > text = concat (entry->text, info, rest); > free (info); > if (entry->text) >@@ -1672,8 +1679,8 @@ > { > char *text; > int add_nl = 1; >- if (entry->text) >- if (entry->text[entry->text_len - 1] == '\n') >+ if (strlen (desc) > 1) >+ if (desc[strlen (desc) - 1] == '\n') > add_nl = 0; > /* Append DESC onto ENTRY->TEXT. */ > text = concat (entry->text == NULL ? "" : entry->text, desc, >@@ -1910,8 +1917,11 @@ > nl[0] = '\0'; > } > /* Concat the description onto the current entry, adding a >- newline if we need one. */ >- next->text = concat (next->text == NULL ? "" : next->text, optarg, >+ newline if we need one. Prepend a space if we have no >+ previous text, since eventually we will be adding the >+ "* foo ()." and we want to end up with a ". " for parsing. */ >+ next->text = concat (next->text ? next->text : " ", >+ optarg, > optarg[length - 1] == '\n' ? "" : "\n"); > next->text_len = strlen (next->text); > } >@@ -1958,20 +1968,20 @@ > size_t length; > if (optarg[0] != '*') > { >- /* Make enough space for "* foo: ().\n". */ >+ /* Make enough space for "* foo: (). ". */ > length = strlen (optarg) + 9; > next->text = xmalloc (length); >- snprintf (next->text, length, "* %s: ().\n", optarg); >+ snprintf (next->text, length, "* %s: (). ", optarg); > next->missing_basename = 1; > /* The basename will be inserted in between the parentheses > at a later time. See add_missing_basenames. */ > } > else > { >- /* Make enough space for "foo\n". */ >+ /* Make enough space for "foo ". */ > length = strlen (optarg) + 2; > next->text = xmalloc (length); >- snprintf (next->text, length, "%s\n", optarg); >+ snprintf (next->text, length, "%s ", optarg); > next->missing_basename = 0; > /* FIXME: check for info entry correctness in TEXT. > e.g. `* Aaa: (bbb).' */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 220695
: 154039