Re: Drop a distracting function from locate(1)

2015-09-20 Thread Otto Moerbeek
On Sat, Sep 19, 2015 at 05:57:23PM -0400, Michael McConville wrote:

> > What's your thinking behind this? To me this seems like a perfectly
> > rational and well motivated function to have, both for readability and
> > rather than having to repeat the same statements several times over in
> > the rest of the code, risking future calamity if a change is made in
> > one place and not the other...
> > 
> > I mean, I don't know if I'm unusual, but I often find myself breaking
> > out separate functions from larger pieces of code, that may end up
> > being called just that one time in a program, just to improve
> > readability and keep things logically apart.
> 
> The most important thing to note is that this diff removes seven lines.
> If you're abstracting something into a function, it definitely shouldn't
> be creating more code.
> 
> When you create functions for things like if (z) errx(...); conditions,
> it makes the code much harder to read. Someone trying to figure out
> what's going on has to find the function definition and remember what it
> does. Extrapolate this for every two-line error condition, and you have
> a major headache. Such functions improve readability only if you're the
> one writing them.
> 
> So, I wouldn't like this function no matter how many times it was used.
> And it only appears twice.

I do not agree. You only have to remeber "that function does sensible
error checking" and you do not have to remember at each spot which
condition is the right one.

Function are the major way of structuring code, use them.

-Otto



Re: flex++ and lex are synonyms for flex(1) in flex.1

2015-09-20 Thread Nicholas Marriott
The .Nm part yes, but but flex++ is not a synonym, flex generates
different output when called as flex++. This is already mentioned in the
later section on C++.


On Sat, Sep 19, 2015 at 10:29:12PM -0400, Rob Pierce wrote:
> Does this makes sense? I took the same approach used in chpass.1.
> 
> Regards,
> 
> Index: flex.1
> ===
> RCS file: /cvs/src/usr.bin/lex/flex.1,v
> retrieving revision 1.41
> diff -u -p -r1.41 flex.1
> --- flex.17 Sep 2015 15:28:06 -   1.41
> +++ flex.120 Sep 2015 02:21:13 -
> @@ -33,7 +33,9 @@
>  .Dt FLEX 1
>  .Os
>  .Sh NAME
> -.Nm flex
> +.Nm flex ,
> +.Nm flex++ ,
> +.Nm lex
>  .Nd fast lexical analyzer generator
>  .Sh SYNOPSIS
>  .Nm
> @@ -69,6 +71,12 @@ library to produce an executable.
>  When the executable is run, it analyzes its input for occurrences
>  of the regular expressions.
>  Whenever it finds one, it executes the corresponding C code.
> +.Pp
> +.Nm flex++
> +and
> +.Nm lex
> +are synonyms for
> +.Nm flex .
>  .Pp
>  The manual includes both tutorial and reference sections:
>  .Bl -ohang
> 



Re: flex++ and lex are synonyms for flex(1) in flex.1

2015-09-20 Thread Rob Pierce
On Sun, Sep 20, 2015 at 02:26:38PM +0100, Nicholas Marriott wrote:
> The .Nm part yes, but but flex++ is not a synonym, flex generates
> different output when called as flex++. This is already mentioned in the
> later section on C++.
> 
> 
> On Sat, Sep 19, 2015 at 10:29:12PM -0400, Rob Pierce wrote:
> > Does this makes sense? I took the same approach used in chpass.1.
> > 
> > Regards,
> > 
> > Index: flex.1
> > ===
> > RCS file: /cvs/src/usr.bin/lex/flex.1,v
> > retrieving revision 1.41
> > diff -u -p -r1.41 flex.1
> > --- flex.1  7 Sep 2015 15:28:06 -   1.41
> > +++ flex.1  20 Sep 2015 02:21:13 -
> > @@ -33,7 +33,9 @@
> >  .Dt FLEX 1
> >  .Os
> >  .Sh NAME
> > -.Nm flex
> > +.Nm flex ,
> > +.Nm flex++ ,
> > +.Nm lex
> >  .Nd fast lexical analyzer generator
> >  .Sh SYNOPSIS
> >  .Nm
> > @@ -69,6 +71,12 @@ library to produce an executable.
> >  When the executable is run, it analyzes its input for occurrences
> >  of the regular expressions.
> >  Whenever it finds one, it executes the corresponding C code.
> > +.Pp
> > +.Nm flex++
> > +and
> > +.Nm lex
> > +are synonyms for
> > +.Nm flex .
> >  .Pp
> >  The manual includes both tutorial and reference sections:
> >  .Bl -ohang
> > 

Ah, yes - thank you.

Since "flex++" is the same as "flex -+", how about this?

I took the wording from apropos.1.

Index: flex.1
===
RCS file: /cvs/src/usr.bin/lex/flex.1,v
retrieving revision 1.41
diff -u -p -r1.41 flex.1
--- flex.1  7 Sep 2015 15:28:06 -   1.41
+++ flex.1  20 Sep 2015 14:27:46 -
@@ -33,7 +33,9 @@
 .Dt FLEX 1
 .Os
 .Sh NAME
-.Nm flex
+.Nm flex ,
+.Nm flex++ ,
+.Nm lex
 .Nd fast lexical analyzer generator
 .Sh SYNOPSIS
 .Nm
@@ -69,6 +71,15 @@ library to produce an executable.
 When the executable is run, it analyzes its input for occurrences
 of the regular expressions.
 Whenever it finds one, it executes the corresponding C code.
+.Pp
+.Nm lex
+is a synonym for
+.Nm flex .
+.Pp
+.Nm flex++
+is a synonym for
+.Nm
+.Fl + .
 .Pp
 The manual includes both tutorial and reference sections:
 .Bl -ohang



Re: [patch] tame.2 documentation about systrace.4

2015-09-20 Thread Jason McIntyre
On Sun, Sep 20, 2015 at 02:57:47PM +0200, Sebastian Benoit wrote:
> Sebastien Marie(sema...@openbsd.org) on 2015.09.20 14:27:01 +0200:
> > Hi,
> > 
> > Mentions that using systrace(4) isn't possible when a program has called
> > tame(2).
> > 
> > Comments ? OK ?
> > -- 
> > Sebastien Marie
> > 
> > Index: lib/libc/sys/tame.2
> > ===
> > RCS file: /cvs/src/lib/libc/sys/tame.2,v
> > retrieving revision 1.27
> > diff -u -p -r1.27 tame.2
> > --- lib/libc/sys/tame.2 11 Sep 2015 09:01:16 -  1.27
> > +++ lib/libc/sys/tame.2 20 Sep 2015 12:26:47 -
> > @@ -431,3 +431,7 @@ The
> >  .Fn tame
> >  system call appeared in
> >  .Ox 5.8 .
> > +.Sh CAVEATS
> > +The use of
> > +.Xr systrace 4
> > +in a tamed program is disable.
> 
> there is a "d" missing at the end.
> 
> And "In a tamed program, systrace(4) is disabled" sounds better to me, but
> jmc might have an opinion on that.
> 
> This could also be mentioned in the systrace(4) manpage, after all, if your
> wondering why systrace doesnt work, you won't know that the program is
> tamed and thus won't look in tame(2)?
> 

i wouldn;t worry about the exact wording too much, but it probably does
make sense to flag it in systrace(4) too.

jmc



Re: [patch] tame.2 documentation about systrace.4

2015-09-20 Thread Jona Joachim
On 2015-09-20, Sebastien Marie  wrote:
> Hi,
>
> Mentions that using systrace(4) isn't possible when a program has called
> tame(2).
>
> Comments ? OK ?

I think you mean "is disable*d*"



[patch] tame.2 documentation about systrace.4

2015-09-20 Thread Sebastien Marie
Hi,

Mentions that using systrace(4) isn't possible when a program has called
tame(2).

Comments ? OK ?
-- 
Sebastien Marie

Index: lib/libc/sys/tame.2
===
RCS file: /cvs/src/lib/libc/sys/tame.2,v
retrieving revision 1.27
diff -u -p -r1.27 tame.2
--- lib/libc/sys/tame.2 11 Sep 2015 09:01:16 -  1.27
+++ lib/libc/sys/tame.2 20 Sep 2015 12:26:47 -
@@ -431,3 +431,7 @@ The
 .Fn tame
 system call appeared in
 .Ox 5.8 .
+.Sh CAVEATS
+The use of
+.Xr systrace 4
+in a tamed program is disable.



Re: [patch] tame.2 documentation about systrace.4

2015-09-20 Thread Sebastian Benoit
Sebastien Marie(sema...@openbsd.org) on 2015.09.20 14:27:01 +0200:
> Hi,
> 
> Mentions that using systrace(4) isn't possible when a program has called
> tame(2).
> 
> Comments ? OK ?
> -- 
> Sebastien Marie
> 
> Index: lib/libc/sys/tame.2
> ===
> RCS file: /cvs/src/lib/libc/sys/tame.2,v
> retrieving revision 1.27
> diff -u -p -r1.27 tame.2
> --- lib/libc/sys/tame.2   11 Sep 2015 09:01:16 -  1.27
> +++ lib/libc/sys/tame.2   20 Sep 2015 12:26:47 -
> @@ -431,3 +431,7 @@ The
>  .Fn tame
>  system call appeared in
>  .Ox 5.8 .
> +.Sh CAVEATS
> +The use of
> +.Xr systrace 4
> +in a tamed program is disable.

there is a "d" missing at the end.

And "In a tamed program, systrace(4) is disabled" sounds better to me, but
jmc might have an opinion on that.

This could also be mentioned in the systrace(4) manpage, after all, if your
wondering why systrace doesnt work, you won't know that the program is
tamed and thus won't look in tame(2)?



Re: Drop a distracting function from locate(1)

2015-09-20 Thread Michael McConville
Otto Moerbeek wrote:
> I do not agree. You only have to remeber "that function does sensible
> error checking" and you do not have to remember at each spot which
> condition is the right one.
> 
> Function are the major way of structuring code, use them.

It's not the idea of functions that I'm questioning. I don't think
making a function for a simple if (x) then errx(...); condition is sane,
though. I'm a bit biased at the moment because I'm searching through the
tree for "creative" replacements for errx() et al.



lighter sleep

2015-09-20 Thread Ted Unangst
/bin/sleep does a lot more work than you'd expect (just ktrace it).

this is because it calls setlocale(). apparently so that isdigit() doesn't get
confused by wacky foreigners with funny numbers.

there is another solution, given that the problem of identifying digits is not
particularly challenging. do it ourselves.

cuts an entire banana boat of calls out of ktrace.


Index: sleep.c
===
RCS file: /cvs/src/bin/sleep/sleep.c,v
retrieving revision 1.20
diff -u -p -r1.20 sleep.c
--- sleep.c 21 Nov 2013 15:54:46 -  1.20
+++ sleep.c 21 Sep 2015 01:44:40 -
@@ -30,7 +30,6 @@
  * SUCH DAMAGE.
  */
 
-#include 
 #include 
 #include 
 #include 
@@ -44,6 +43,12 @@ extern char *__progname;
 void usage(void);
 void alarmh(int);
 
+static int
+isnumber(int x)
+{
+   return x >= '0' && x <= '9';
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -54,8 +59,6 @@ main(int argc, char *argv[])
struct timespec rqtp;
int i;
 
-   setlocale(LC_ALL, "");
-
signal(SIGALRM, alarmh);
 
while ((ch = getopt(argc, argv, "")) != -1)
@@ -71,7 +74,7 @@ main(int argc, char *argv[])
 
cp = *argv;
while ((*cp != '\0') && (*cp != '.')) {
-   if (!isdigit((unsigned char)*cp))
+   if (!isnumber((unsigned char)*cp))
usage();
t = (secs * 10) + (*cp++ - '0');
if (t / 10 != secs) /* oflow */
@@ -85,7 +88,7 @@ main(int argc, char *argv[])
for (i = 1; i > 0; i /= 10) {
if (*cp == '\0')
break;
-   if (!isdigit((unsigned char)*cp))
+   if (!isnumber((unsigned char)*cp))
usage();
nsecs += (*cp++ - '0') * i;
}
@@ -96,7 +99,7 @@ main(int argc, char *argv[])
 * checking the rest of the argument.
 */
while (*cp != '\0') {
-   if (!isdigit((unsigned char)*cp++))
+   if (!isnumber((unsigned char)*cp++))
usage();
}
}



Re: Drop a distracting function from locate(1)

2015-09-20 Thread Otto Moerbeek
On Sun, Sep 20, 2015 at 07:43:46AM -0400, Michael McConville wrote:

> Otto Moerbeek wrote:
> > I do not agree. You only have to remeber "that function does sensible
> > error checking" and you do not have to remember at each spot which
> > condition is the right one.
> > 
> > Function are the major way of structuring code, use them.
> 
> It's not the idea of functions that I'm questioning. I don't think
> making a function for a simple if (x) then errx(...); condition is sane,
> though. I'm a bit biased at the moment because I'm searching through the
> tree for "creative" replacements for errx() et al.

If x is an expression involving relational operators, I do not like to
see multiple copies of that. e.g. verifying if a condition should use
> or >= is often hard enough. If I have to check that in multiple
places, I'm wasting effort. Also, if I see a bug and fix it, I do like
the fact that I do not have to check multiple occurrences of the same
expression and decide if they are really the same or not.

So even if a function increases the number of lines in a program,
often it reduces complexity.

-Otto



Re: Drop a distracting function from locate(1)

2015-09-20 Thread Ted Unangst
Michael McConville wrote:

I'm late to the party, but we could tidy things up a bit by moving the
function into the c file it's used in and using errx() internally.

> Index: locate/fastfind.c
> ===
> RCS file: /cvs/src/usr.bin/locate/locate/fastfind.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 fastfind.c
> --- locate/fastfind.c 16 Jan 2015 06:40:09 -  1.12
> +++ locate/fastfind.c 19 Sep 2015 18:28:30 -
> @@ -65,7 +65,8 @@ statistic (fp, path_fcodes)
>   } else
>   count += c - OFFSET;
>  
> - sane_count(count);
> + if (count < 0 || count >= PATH_MAX)
> + errx(1, "corrupted database");
>   for (p = path + count; (c = getc(fp)) > SWITCH; size++)
>   if (c < PARITY) {
>   if (c == UMLAUT) {
> @@ -212,7 +213,8 @@ fastfind
>   count += c - OFFSET;
>   }
>  
> - sane_count(count);
> + if (count < 0 || count >= PATH_MAX)
> + errx(1, "corrupted database");
>   /* overlay old path */
>   p = path + count;
>   foundchar = p - 1;
> Index: locate/locate.c
> ===
> RCS file: /cvs/src/usr.bin/locate/locate/locate.c,v
> retrieving revision 1.26
> diff -u -p -r1.26 locate.c
> --- locate/locate.c   16 Jan 2015 06:40:09 -  1.26
> +++ locate/locate.c   19 Sep 2015 18:28:30 -
> @@ -331,15 +331,6 @@ usage(void)
>   exit(1);
>  }
>  
> -void
> -sane_count(int count)
> -{
> - if (count < 0 || count >= PATH_MAX) {
> - fprintf(stderr, "locate: corrupted database\n");
> - exit(1);
> - }
> -}
> -
>  /* load fastfind functions */
>  
>  /* statistic */
> 



Re: lighter sleep

2015-09-20 Thread Philip Guenther
On Sun, Sep 20, 2015 at 6:49 PM, Ted Unangst  wrote:
> /bin/sleep does a lot more work than you'd expect (just ktrace it).
>
> this is because it calls setlocale(). apparently so that isdigit() doesn't get
> confused by wacky foreigners with funny numbers.
>
> there is another solution, given that the problem of identifying digits is not
> particularly challenging. do it ourselves.
>
> cuts an entire banana boat of calls out of ktrace.

I think this is the wrong direction.  We want better support for
locales and UTF-8: if the current support is inefficient then we
should be fixing that, not disabling it.


Philip Guenther



Re: lighter sleep

2015-09-20 Thread Bob Beck
I concur, I don't want to see a plethora of "isnumber"
"ismaybeanumber" bullshit in the tree that
do the same thing "isdigit" does.. if for whatever reason we want
isdigit to be more efficient because
the most important thing I have to do is make shell sleep more
efficient, we should fix isdigit, or the locale poo..

But for sure not introduce non-standard ascii-only replacements into
all code that do not quite what libc does..

Jesus ted did you learn nothing from OpenSSL? :)


On Sun, Sep 20, 2015 at 8:27 PM, Philip Guenther  wrote:
> On Sun, Sep 20, 2015 at 6:49 PM, Ted Unangst  wrote:
>> /bin/sleep does a lot more work than you'd expect (just ktrace it).
>>
>> this is because it calls setlocale(). apparently so that isdigit() doesn't 
>> get
>> confused by wacky foreigners with funny numbers.
>>
>> there is another solution, given that the problem of identifying digits is 
>> not
>> particularly challenging. do it ourselves.
>>
>> cuts an entire banana boat of calls out of ktrace.
>
> I think this is the wrong direction.  We want better support for
> locales and UTF-8: if the current support is inefficient then we
> should be fixing that, not disabling it.
>
>
> Philip Guenther
>



Re: UTF-8 string filtering

2015-09-20 Thread Damien Miller
On Sat, 12 Sep 2015, Stefan Sperling wrote:

> 
> On Fri, Sep 04, 2015 at 03:17:31PM +1000, Damien Miller wrote:
> > Hi,
> > 
> > For a long time OpenBSD has been careful about filtering potentially-
> > hostile strings that were destined for logs or TTYs using strvis(3) and
> > friends. Unfortunately, these don't do a great job for UTF-8 strings
> > since they mangle anything that isn't basic ASCII (not even ISO-8859-1).
> 
> Any news on this? I'd like to use it.

Here's the current version of the patch that incorporates most of the
feedback I received on the old one. I was hoping that someone could
pick it up at the utf8 hackathon and convert it to be a libutil
function.


diff --git a/lib/Makefile b/lib/Makefile
index ed505b4..05cf8a0 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -34,7 +34,8 @@ SRCS= ${LIB_SRCS} \
smult_curve25519_ref.c \
kexc25519.c kexc25519c.c kexc25519s.c \
roaming_dummy.c \
-   chacha.c poly1305.c cipher-chachapoly.c ssh-ed25519.c hmac.c umac.c
+   chacha.c poly1305.c cipher-chachapoly.c ssh-ed25519.c hmac.c umac.c \
+   utf8_stringprep.c
 
 .if (${SSH1:L} == "yes")
 SRCS+= cipher-3des1.c cipher-bf1.c
diff --git a/misc.h b/misc.h
index 53d469b..e476f1d 100644
--- a/misc.h
+++ b/misc.h
@@ -133,4 +133,7 @@ char*read_passphrase(const char *, int);
 int ask_permission(const char *, ...) __attribute__((format(printf, 1, 
2)));
 int read_keyfile_line(FILE *, const char *, char *, size_t, u_long *);
 
+/* utf8_stringprep.c */
+int utf8_stringprep(const char *, char *, size_t);
+
 #endif /* _MISC_H */
diff --git a/ssh.c b/ssh.c
index 2275b6e..b235a68 100644
--- a/ssh.c
+++ b/ssh.c
@@ -62,6 +62,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef WITH_OPENSSL
 #include 
@@ -500,6 +501,8 @@ main(int ac, char **av)
struct ssh_digest_ctx *md;
u_char conn_hash[SSH_DIGEST_MAX_LENGTH];
 
+   setlocale(LC_CTYPE, "");
+
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
sanitise_stdfd();
 
diff --git a/sshconnect2.c b/sshconnect2.c
index 2b525ac..162befe 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -39,6 +39,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "xmalloc.h"
 #include "ssh.h"
@@ -455,21 +457,53 @@ input_userauth_error(int type, u_int32_t seq, void *ctxt)
return 0;
 }
 
+/*
+ * Check whether we can display UTF-8 safely.
+ * NB. requires setlocale() to have been called.
+ */
+static int
+utf8_ok(void)
+{
+   static int ret = -1;
+   char *cp;
+
+   if (ret == -1) {
+   cp = nl_langinfo(CODESET);
+   ret = strcmp(cp, "UTF-8") == 0;
+   }
+   return ret;
+}
+
 /* ARGSUSED */
 int
 input_userauth_banner(int type, u_int32_t seq, void *ctxt)
 {
char *msg, *raw, *lang;
-   u_int len;
+   u_int done, len;
 
debug3("input_userauth_banner");
+
raw = packet_get_string();
lang = packet_get_string(NULL);
if (len > 0 && options.log_level >= SYSLOG_LEVEL_INFO) {
if (len > 65536)
len = 65536;
msg = xmalloc(len * 4 + 1); /* max expansion from strnvis() */
-   strnvis(msg, raw, len * 4 + 1, VIS_SAFE|VIS_OCTAL|VIS_NOSLASH);
+   done = 0;
+   if (utf8_ok()) {
+   if (utf8_stringprep(raw, msg, len * 4 + 1) == 0)
+   done = 1;
+   else
+   debug2("%s: UTF8 stringprep failed", __func__);
+   }
+   /*
+* Fallback to strnvis if UTF8 display not supported or
+* conversion failed.
+*/
+   if (!done) {
+   strnvis(msg, raw, len * 4 + 1,
+   VIS_SAFE|VIS_OCTAL|VIS_NOSLASH);
+   }
fprintf(stderr, "%s", msg);
free(msg);
}
diff --git a/stringprep-tables.c b/stringprep-tables.c
new file mode 100644
index 000..49f4d9d
--- /dev/null
+++ b/stringprep-tables.c
@@ -0,0 +1,661 @@
+/* Public domain.  */
+
+/* $OpenBSD$ */
+
+/*
+ * Tables for RFC3454 stringprep algorithm, updated with a table of allocated
+ * characters generated from Unicode.6.2's UnicodeData.txt
+ *
+ * Intended to be included directly from utf8_stringprep.c
+ */
+
+/* Unassigned characters in Unicode 6.2 */
+static const struct u32_range unassigned[] = {
+   { 0x0378, 0x0379 },
+   { 0x037F, 0x0383 },
+   { 0x038B, 0x038B },
+   { 0x038D, 0x038D },
+   { 0x03A2, 0x03A2 },
+   { 0x0528, 0x0530 },
+   { 0x0557, 0x0558 },
+   { 0x0560, 0x0560 },
+   { 0x0588, 0x0588 },
+   { 0x058B, 0x058E },
+   { 0x0590, 0x0590 },
+   { 0x05C8, 0x05CF },
+   { 0x05EB, 0x05EF },
+   { 0x05F5, 0x05FF },
+   { 0x0605, 0x0605 },
+   { 0x061C, 0x061D },
+   { 0x070E, 0x070E },
+   { 0x074B, 0x074C },
+   { 

Re: bsd.port.mk.5: fix an external reference

2015-09-20 Thread Jason McIntyre
On Sat, Sep 19, 2015 at 03:16:01PM -0400, Michael Reed wrote:
> Index: bsd.port.mk.5
> ===
> RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
> retrieving revision 1.420
> diff -u -p -r1.420 bsd.port.mk.5
> --- bsd.port.mk.5 16 Sep 2015 19:59:57 -  1.420
> +++ bsd.port.mk.5 19 Sep 2015 19:13:18 -
> @@ -560,7 +560,7 @@ Resolve
>  .Ev WANTLIB
>  against the ports tree itself and system libraries, without looking at built
>  or installed packages, and writes a list of options suitable for
> -.Xr pkg-create 1 .
> +.Xr pkg_create 1 .
>  See
>  .Ar print-package-args .
>  .It Ar prepare
> 

fixed, thanks.
jmc



sparc: increase MAXTSIZ for running bloatware

2015-09-20 Thread Tobias Ulmer
Required for building gcc/gnat [and firefox, soon... ;p]

ok?

Index: arch/sparc/include/vmparam.h
===
RCS file: /home/vcs/cvs/openbsd/src/sys/arch/sparc/include/vmparam.h,v
retrieving revision 1.47
diff -u -p -r1.47 vmparam.h
--- arch/sparc/include/vmparam.h18 Sep 2015 12:50:27 -  1.47
+++ arch/sparc/include/vmparam.h20 Sep 2015 18:45:35 -
@@ -52,7 +52,7 @@
  * Virtual memory related constants, all in bytes
  */
 #ifndef MAXTSIZ
-#defineMAXTSIZ (32*1024*1024)  /* max text size */
+#defineMAXTSIZ (64*1024*1024)  /* max text size */
 #endif
 #ifndef DFLDSIZ
 #defineDFLDSIZ (64*1024*1024)  /* initial data size 
limit */



bsd.port.mk.5: Use Xr where appropriate

2015-09-20 Thread Michael Reed
Index: src/share/man/man5/bsd.port.mk.5
===
RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
retrieving revision 1.421
diff -u -p -r1.421 bsd.port.mk.5
--- src/share/man/man5/bsd.port.mk.520 Sep 2015 18:20:37 -  1.421
+++ src/share/man/man5/bsd.port.mk.520 Sep 2015 19:48:04 -
@@ -291,10 +291,9 @@ to change behavior.
 Do not touch
 .Ar pre-fake
 unless you really know what you are doing.
-Described in a separate section below
-.Po
-.Qq THE FAKE FRAMEWORK
-.Pc .
+See the
+.Sx THE FAKE FRAMEWORK
+section below.
 .It Ar fake-wantlib-args
 Check
 .Ev WANTLIB
@@ -379,8 +378,8 @@ Top-level target, see
 .It Ar install
 Install the package after building.
 See the description of
-.Qq THE FAKE FRAMEWORK
-for the non-intuitive details of the way
+.Sx THE FAKE FRAMEWORK
+section for the non-intuitive details of the way
 .Ar {pre,do,post}-install
 hooks are actually used by the ports tree.
 .It Ar install-all
@@ -573,7 +572,7 @@ In
 .Ev MULTI_PACKAGES
 setups,
 see
-.Qq Flavors and multi-packages .
+.Sx FLAVORS AND MULTI_PACKAGES .
 .It Ar print-package-args
 Print all dependency-related information that will be passed as parameters
 to
@@ -885,7 +884,7 @@ In a
 .Ev MULTI_PACKAGES
 setup, some variables have settings specific to a given subpackage.
 See
-.Qq Flavors and multi-packages .
+.Sx FLAVORS AND MULTI_PACKAGES .
 .Bl -tag -width MASTER_SITES
 .It Ev show
 Invoked as make show=name, show the contents of ${name}.
@@ -1005,7 +1004,7 @@ and
 The actual list of packages that will be built, once architecture problems
 and pseudo-flavors have been taken into account.
 See
-.Qq Flavors and multi-packages .
+.Sx FLAVORS AND MULTI_PACKAGES .
 .It Ev BROKEN
 Define only for broken ports, set to reason the port is broken.
 See also
@@ -1584,8 +1583,8 @@ Exposed so that modules may provide thei
 .Ar do-install .
 Read-only,
 see
-.Qq THE FAKE FRAMEWORK
-for details.
+.Sx THE FAKE FRAMEWORK
+section for details.
 .It Ev FAKE_TARGET
 Target built by ${MAKE_PROGRAM} on fake invocation.
 Defaults to ${INSTALL_TARGET}.
@@ -2009,7 +2008,7 @@ See
 .It Ev MULTI_PACKAGES
 Set to a list of subpackage extensions for ports that create multiple packages.
 See
-.Qq Flavors and multi-packages
+.Sx FLAVORS AND MULTI_PACKAGES
 below.
 Especially read the part about
 .Ev ONLY_FOR_ARCHS
@@ -2117,7 +2116,7 @@ Can hold both processor-specific informa
 specific model information (e.g., macppc).
 This is subpackage dependent.
 Read the corresponding part of
-.Qq Flavors and multi-packages
+.Sx FLAVORS AND MULTI_PACKAGES
 if some subpackages should only be built on some architectures.
 .It Ev OSREV
 Revision number of
@@ -2272,7 +2271,7 @@ Special arguments to pass to
 .Xr pkg_create 1 ,
 in addition to the default ones.
 For mips64 and pic libraries, see
-.Qq The generation of package information .
+.Sx THE GENERATION OF PACKAGE INFORMATION .
 .It Ev PKG_CREATE
 User settings.
 Path to
@@ -2886,8 +2885,8 @@ Mostly the same as ${PREFIX}, except it 
 during
 .Ar fake .
 Refer to
-.Qq THE FAKE FRAMEWORK
-for details.
+.Sx THE FAKE FRAMEWORK
+section for details.
 .It Ev TRY_BROKEN
 User settings.
 If set to
@@ -3407,7 +3406,9 @@ get copied to
 .Pa ${WRKINST}
 at the end of
 .Ar fake
-(see the FILES section above for details).
+(see the
+.Sx FILES
+section above for details).
 .Sh FLAVORS AND MULTI_PACKAGES
 Starting with
 .Ox 2.7 ,