From owner-svn-src-head@freebsd.org Sat Aug 17 02:36:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70D67B8990; Sat, 17 Aug 2019 02:36:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 469PTR261bz3Mm0; Sat, 17 Aug 2019 02:36:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05D67AE4B; Sat, 17 Aug 2019 02:36:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7H2ag89033314; Sat, 17 Aug 2019 02:36:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7H2agPD033313; Sat, 17 Aug 2019 02:36:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908170236.x7H2agPD033313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Aug 2019 02:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351157 - head/usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/config X-SVN-Commit-Revision: 351157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Aug 2019 02:36:43 -0000 Author: imp Date: Sat Aug 17 02:36:42 2019 New Revision: 351157 URL: https://svnweb.freebsd.org/changeset/base/351157 Log: Fix small bug in wrapping introduced in r325955. When local support was fixed, it introduced a minor bug in formatting. We don't increment the lpos by enouogh, so lines are a little too long. Adjust to be correct now with variable length srcprefix. Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Sat Aug 17 02:36:37 2019 (r351156) +++ head/usr.sbin/config/mkmakefile.c Sat Aug 17 02:36:42 2019 (r351157) @@ -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)