discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Peter Bray <pdb_ml@yahoo.com.au>
To: discuss@mdocml.bsd.lv
Subject: Solaris 10 regcomp() does not handle simple whatis query
Date: Fri, 03 Apr 2015 23:02:16 +1100	[thread overview]
Message-ID: <551E8148.7070004@yahoo.com.au> (raw)

Greetings,

I am having trouble viewing the GMAME web archive of the mailing
list, so please excuse me if this post is a repeat of a known issue.

I was investigating mdocml on a Solaris 10 (X86_64) system and
discovered that the latest release does not compile, but the latest
CVS 2015-04-01 does :-) Many thanks to those responsible!

Using the configure.local shown at the end of this message, I was able
to build and use mdocml ;-)

My testing shows that Solaris 10's regcomp() can not handle the
character class used by mdocml's whatis(1): for example: the query
'whatis' generates "[[:<:]]whatis[[:>:]]" which gives the error
"regcomp: invalid character class type", as shown below

   makewhatis  /pkgs/64-bit/release/mdocml-cvs_2014_04_01-basic/share/man
   whatis -M /pkgs/64-bit/release/mdocml-cvs_2014_04_01-basic/share/man 
whatis
regcomp: invalid character class type
usage: whatis [-acfhklw] [-C file] [-M path] [-m path] [-O outkey] [-S arch]
               [-s section] name ...

   apptrace whatis -M 
/pkgs/64-bit/release/mdocml-cvs_2014_04_01-basic/share/man whatis
...<snip>...
-> whatis   -> libc.so.1:int vasprintf(char ** = 0xfffffd7fffdfdcf8, 
const char * = 0x45951e "[[:<:]]%s[[:>:]]", struct __va_list_tag * = 
0xfffffd7fffdfdbf0)
<- whatis   -> libc.so.1:vasprintf() = 0x14
-> whatis   -> libc.so.1:int regcomp(regex_t * = 0x47fd10, const char * 
= 0x47fd90 "[[:<:]]whatis[[:>:]]", int = 0x7)
<- whatis   -> libc.so.1:regcomp() = 0xd
-> whatis   -> libc.so.1:void free(void * = 0x47fd90)
<- whatis   -> libc.so.1:free()
-> whatis   -> libc.so.1:size_t regerror(int = 0xd, const regex_t * = 
0x47fd10, char * = 0xfffffd7fffdfdd00 "...<random_junk>...", size_t = 0x400)
<- whatis   -> libc.so.1:regerror() = 0x1d
-> whatis   -> libc.so.1:int fprintf(FILE * = 0x47b980, const char * = 
0x459537 "regcomp: %s
")
regcomp: invalid character class type
...<snip>...


This is from mansearch.c's exprterm()

    756  static struct expr *
    757  exprterm(const struct mansearch *search, char *buf, int cs)
    758  {
...
    777          /*
    778           * Separate macro keys from search string.
    779           * If needed, request regular expression handling
    780           * by setting e->substr to NULL.
    781           */
    782
    783          if (search->argmode == ARG_WORD) {
    784                  e->bits = TYPE_Nm;
    785                  e->substr = NULL;
    786                  mandoc_asprintf(&val, "[[:<:]]%s[[:>:]]", buf);
    787                  cs = 0;

Depending on the complexity, maybe a BSD version of regcomp() could be
included with mdocml, to get the desired functionality and not have to
reduce the functionality currently available to mdocml users.
Alternatively, the code could make exceptions for broken (by the
project's standards) regcomp() implementations.

Regards,
Peter Bray
Sydney, Australia

# Local Configuration Options
cat configure.local

PREFIX="/pkgs/64-bit/release/mdocml-cvs_2014_04_01-basic"
MANDIR="${PREFIX}/share/man"
INSTALL="ginstall"
DBLIB="-L/pkgs/64-bit/lib -lsqlite3"
CFLAGS="${CFLAGS} -I/pkgs/64-bit/include"
MANPATH_DEFAULT="/pkgs/64-bit/man:/pkgs/64-bit/share/man:/pkgs/man:/pkgs/share/man:/usr/share/man"
# roff.7 conflicts with groff's version, make all section 7 manual 
entries unique
MANM_MAN="mandoc_man"           # default is "man"
MANM_MDOC="mandoc_mdoc"         # default is "mdoc"
MANM_ROFF="mandoc_roff"         # default is "roff"
MANM_EQN="mandoc_eqn"           # default is "eqn"
MANM_TBL="mandoc_tbl"           # default is "tbl"
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

             reply	other threads:[~2015-04-03 12:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03 12:02 Peter Bray [this message]
2015-04-03 12:52 ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=551E8148.7070004@yahoo.com.au \
    --to=pdb_ml@yahoo.com.au \
    --cc=discuss@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).