From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 53c995da; for ; Wed, 29 Apr 2015 06:11:12 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (envelope-from ) id 1YnPtW-0007Zm-66; Wed, 29 Apr 2015 13:11:11 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1YnPtW-0005Kq-17; Wed, 29 Apr 2015 13:11:10 +0200 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.80) (envelope-from ) id 1YnPtV-00018k-TU; Wed, 29 Apr 2015 13:11:09 +0200 Received: from localhost (1031@localhost [local]); by localhost (OpenSMTPD) with ESMTPA id 16b60285; Wed, 29 Apr 2015 13:11:09 +0200 (CEST) Date: Wed, 29 Apr 2015 13:11:09 +0200 From: Ingo Schwarze To: Lorenzo Beretta Cc: tech@mdocml.bsd.lv Subject: Re: Debian's more is /bin/more, not /usr/bin/more Message-ID: <20150429111109.GB10387@athene.usta.de> References: X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Hi Lorenzo, Lorenzo Beretta wrote on Sat, Apr 25, 2015 at 04:16:08PM +0200: > Just a minor annoyance, but anyway... > > # download & install mdocml... > $ man ls > man: exec: No such file or directory > $ type man more > man is /usr/local/bin/man > more is /bin/more > $ PAGER="more -s" man ls > # manpage is shown correctly > > Until we solve /bin vs /usr/bin (cough gobolinux cough , how about > defaulting to "more -s" instead of "/usr/bin/more -s"? That was already done three weeks before your report in the first commit appended below. > Regardless, the error message wasn't really clear - could you replace > fprintf(stderr, "%s: exec: %s\n", > progname, strerror(errno)); > with something like > fprintf(stderr, "%s: exec %s: %s\n", > progname, argv[0], strerror(errno)); > ? Good idea, done, thanks, see the second commit appended below. Yours, Ingo Log Message: ----------- No need to hardcode /usr/bin/ as the path to more(1); helps portability. We don't hardcode the paths to gunzip(1) and cmp(1) either. Discussed with ajacoutot@. Modified Files: -------------- mdocml: apropos.1 main.c man.1 mandoc.1 Revision Data ------------- Index: man.1 =================================================================== RCS file: /home/cvs/mdocml/mdocml/man.1,v retrieving revision 1.13 retrieving revision 1.14 diff -Lman.1 -Lman.1 -u -p -r1.13 -r1.14 --- man.1 +++ man.1 @@ -381,7 +381,8 @@ Specifies the pagination program to use .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, -.Pa /usr/bin/more Fl s +.Xr more 1 +.Fl s will be used. .El .Sh FILES Index: main.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/main.c,v retrieving revision 1.231 retrieving revision 1.232 diff -Lmain.c -Lmain.c -u -p -r1.231 -r1.232 --- main.c +++ main.c @@ -997,7 +997,7 @@ spawn_pager(void) if (pager == NULL || *pager == '\0') pager = getenv("PAGER"); if (pager == NULL || *pager == '\0') - pager = "/usr/bin/more -s"; + pager = "more -s"; cp = mandoc_strdup(pager); /* Index: mandoc.1 =================================================================== RCS file: /home/cvs/mdocml/mdocml/mandoc.1,v retrieving revision 1.158 retrieving revision 1.159 diff -Lmandoc.1 -Lmandoc.1 -u -p -r1.158 -r1.159 --- mandoc.1 +++ mandoc.1 @@ -502,7 +502,8 @@ Specifies the pagination program to use .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, -.Pa /usr/bin/more Fl s +.Xr more 1 +.Fl s will be used. .El .Sh EXIT STATUS Index: apropos.1 =================================================================== RCS file: /home/cvs/mdocml/mdocml/apropos.1,v retrieving revision 1.38 retrieving revision 1.39 diff -Lapropos.1 -Lapropos.1 -u -p -r1.38 -r1.39 --- apropos.1 +++ apropos.1 @@ -365,7 +365,8 @@ Specifies the pagination program to use .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, -.Pa /usr/bin/more Fl s +.Xr more 1 +.Fl s will be used. .El .Sh FILES Log Message: ----------- Improve the error message in case somebody has configured an invalid PAGER. Suggested by Lorenzo Beretta . Modified Files: -------------- mdocml: main.c Revision Data ------------- Index: main.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/main.c,v retrieving revision 1.237 retrieving revision 1.238 diff -Lmain.c -Lmain.c -u -p -r1.237 -r1.238 --- main.c +++ main.c @@ -1027,7 +1027,7 @@ spawn_pager(void) /* Hand over to the pager. */ execvp(argv[0], argv); - fprintf(stderr, "%s: exec: %s\n", - progname, strerror(errno)); + fprintf(stderr, "%s: exec %s: %s\n", + progname, argv[0], strerror(errno)); exit((int)MANDOCLEVEL_SYSERR); } -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv