aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2019-08-17 02:36:42 +0000
committerWarner Losh <imp@FreeBSD.org>2019-08-17 02:36:42 +0000
commit2bc9c25782aed3b1bbca8b617b161a56fbaa9009 (patch)
tree6ee29884120c9473c8ab0b6009b34b3b84be2301
parent44fcf30bdd77296f3021de05e245caa345b620c9 (diff)
Notes
-rw-r--r--usr.sbin/config/mkmakefile.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 5532a281311b..19861b30b6cf 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -639,17 +639,16 @@ do_before_depend(FILE *fp)
lpos = 15;
STAILQ_FOREACH(tp, &ftab, f_next)
if (tp->f_flags & BEFORE_DEPEND) {
- len = strlen(tp->f_fn);
- if ((len = 3 + len) + lpos > 72) {
+ len = strlen(tp->f_fn) + strlen(tp->f_srcprefix);
+ if (len + lpos > 72) {
lpos = 8;
fputs("\\\n\t", fp);
}
if (tp->f_flags & NO_IMPLCT_RULE)
- fprintf(fp, "%s ", tp->f_fn);
+ lpos += fprintf(fp, "%s ", tp->f_fn);
else
- fprintf(fp, "%s%s ", tp->f_srcprefix,
+ lpos += fprintf(fp, "%s%s ", tp->f_srcprefix,
tp->f_fn);
- lpos += len + 1;
}
if (lpos != 8)
putc('\n', fp);
@@ -709,12 +708,11 @@ do_xxfiles(char *tag, FILE *fp)
continue;
if (strcasecmp(&tp->f_fn[len - slen], suff) != 0)
continue;
- if ((len = 3 + len) + lpos > 72) {
+ if (len + strlen(tp->f_srcprefix) + lpos > 72) {
lpos = 8;
fputs("\\\n\t", fp);
}
- fprintf(fp, "%s%s ", tp->f_srcprefix, tp->f_fn);
- lpos += len + 1;
+ lpos += fprintf(fp, "%s%s ", tp->f_srcprefix, tp->f_fn);
}
free(suff);
if (lpos != 8)