diff options
author | Yitzchak Scott-Thoennes <sthoenna@efn.org> | 2005-03-08 09:46:04 -0800 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-03-21 21:22:10 +0000 |
commit | efcaa95b05d30c10585967bb358126b84bd75b53 (patch) | |
tree | 44e096980a58fea8a872a73e3d09fbd6193054c1 /perl.c | |
parent | 96746c4ecc25e998d69434161d50eb699acbb9b4 (diff) | |
download | perl-efcaa95b05d30c10585967bb358126b84bd75b53.tar.gz |
Break up long lines in -V output for compile-time options
Subject: Re: sitecustomize.pl [PATCH]
From: sthoenna[at]efn.org (Yitzchak Scott-Thoennes)
Message-ID: <20050309014604.GA5876[at]efn.org>
p4raw-id: //depot/perl@24058
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -1361,12 +1361,16 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit) PL_preambleav = newAV(); av_push(PL_preambleav, newSVpv("use Config qw(myconfig config_vars)",0)); if (*++s != ':') { + STRLEN opts; + PL_Sv = newSVpv("print myconfig();",0); #ifdef VMS sv_catpv(PL_Sv,"print \"\\nCharacteristics of this PERLSHR image: \\n\","); #else sv_catpv(PL_Sv,"print \"\\nCharacteristics of this binary (from libperl): \\n\","); #endif + opts = SvCUR(PL_Sv); + sv_catpv(PL_Sv,"\" Compile-time options:"); # ifdef DEBUGGING sv_catpv(PL_Sv," DEBUGGING"); @@ -1404,6 +1408,24 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit) # ifdef PERL_IMPLICIT_SYS sv_catpv(PL_Sv," PERL_IMPLICIT_SYS"); # endif + + while (SvCUR(PL_Sv) > opts+76) { + /* find last space after "options: " and before col 76 */ + + char *space, *pv = SvPV_nolen(PL_Sv); + char c = pv[opts+76]; + pv[opts+76] = '\0'; + space = strrchr(pv+opts+26, ' '); + pv[opts+76] = c; + if (!space) break; /* "Can't happen" */ + + /* break the line before that space */ + + opts = space - pv; + sv_insert(PL_Sv, opts, 0, + "\\n ", 25); + } + sv_catpv(PL_Sv,"\\n\","); #if defined(LOCAL_PATCH_COUNT) |