[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30785: Man pages truncated, repeated

From: Pierre Neidhardt
Subject: bug#30785: Man pages truncated, repeated
Date: Mon, 14 Jan 2019 17:57:12 +0100
User-agent: mu4e 1.0; emacs 26.1

> (libs/libgroff/localcharset.c's locale_charset looks overly complicated, WTF?)

Oh dear... relocatep.cpp is not much better, here is the offending function:

--8<---------------cut here---------------start------------->8---
// Strip the installation prefix and replace it
// with the current installation prefix; return the relocated path.
char *relocatep(const char *path)
  fprintf(stderr, "relocatep: path = %s\n", path);
  fprintf(stderr, "relocatep: INSTALLPATH = %s\n", INSTALLPATH);
  fprintf(stderr, "relocatep: INSTALLPATHLEN = %d\n", INSTALLPATHLEN);
  if (!curr_prefix)
    return strsave(path);
  char *relative_path = (char *)path + INSTALLPATHLEN;
  size_t relative_path_len = strlen(relative_path);
  char *relocated_path = new char[curr_prefix_len + relative_path_len + 1];
  strcpy(relocated_path, curr_prefix);
  strcat(relocated_path, relative_path);
  fprintf(stderr, "relocated_path: %s\n", relocated_path);
#endif /* DEBUG */
  return relocated_path;
--8<---------------cut here---------------end--------------->8---

I don't even get the use case of the function...  From locale_charset, it seems
that the argument is LIBDIR.

So maybe INSTALLPATH and/or LIBDIR is not properly set when we compile groff.

> Maybe argv[0] is still the cause, but try setting the environment variable
> LC_ALL to "C" to disable locales before invoking "man".  Does this make it not
> crash?

This works indeed!  Can you see a fix then?

Pierre Neidhardt

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]