From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 19 12:06:40 2012 Received: (at submit) by debbugs.gnu.org; 19 Dec 2012 17:06:40 +0000 Received: from localhost ([127.0.0.1]:51097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlN6N-0000WG-FH for submit@debbugs.gnu.org; Wed, 19 Dec 2012 12:06:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40480) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlMtc-0000Ar-2g for submit@debbugs.gnu.org; Wed, 19 Dec 2012 11:53:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlMtR-0005yz-QP for submit@debbugs.gnu.org; Wed, 19 Dec 2012 11:53:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:43925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlMtR-0005yv-MV for submit@debbugs.gnu.org; Wed, 19 Dec 2012 11:53:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlMtO-0007hN-B4 for bug-coreutils@gnu.org; Wed, 19 Dec 2012 11:53:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlMtK-0005xL-ML for bug-coreutils@gnu.org; Wed, 19 Dec 2012 11:53:14 -0500 Received: from mail-wg0-f45.google.com ([74.125.82.45]:63422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlMtK-0005x3-Ca for bug-coreutils@gnu.org; Wed, 19 Dec 2012 11:53:10 -0500 Received: by mail-wg0-f45.google.com with SMTP id dq12so1062182wgb.12 for ; Wed, 19 Dec 2012 08:53:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:organization:user-agent :mime-version:to:subject:content-type; bh=Omi3bpvODdY0Zex4uM5a5xWb6V/zpRQPxGszpD4P5x4=; b=vzRco8uN1HLiKInOpkNMa07zt/atTPQ12CAPr0knvo5L8fiJkL8STBSBdXlLessAHQ 0YdpCUe+oqi/fwErrX2nLiHRKa0ajNW2EmhvRfYXAOk1R1KiNd6kMo8676IqXmTsv2gm gR0u/LCUYn6I8lQL47S3uGkk6L+GwvfuefIb9HxyxDYma9V9TIZ78UEwYWulsCzm3w+L lreopYGH7Btb5V4VyHVW95UlfQ9iT5GqQxTpUX+T/3uw2eQR7HUIbEUcfgIgTEfOK7Q/ hCf9JqLjEY31Oszhw3D9MgzWqIfP3B1QPTVr7k+9Ogqq0h+X/22nCk411evVYoJjAOCv 141Q== X-Received: by 10.180.88.138 with SMTP id bg10mr12306379wib.13.1355935988901; Wed, 19 Dec 2012 08:53:08 -0800 (PST) Received: from [10.1.211.207] (fw-103.apa.at. [194.232.128.103]) by mx.google.com with ESMTPS id s16sm16277207wii.0.2012.12.19.08.53.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Dec 2012 08:53:08 -0800 (PST) Message-ID: <50D1F0F3.3040307@gmail.com> Date: Wed, 19 Dec 2012 17:53:07 +0100 From: Philipp Gortan Organization: APA-IT User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121203 Thunderbird/10.0.11 MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: seq -s broken in coretutils 8.20? Content-Type: multipart/mixed; boundary="------------020109010009040002020308" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 19 Dec 2012 12:06:38 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) This is a multi-part message in MIME format. --------------020109010009040002020308 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Dear coreutils crowd, I recently upgraded the coreutils on my Gentoo AMD64 from 8.16 to 8.20. I used the seq command to generate the values of an SQL "in" statement. Since I upgraded, the SQL is no longer correct - here is what I found out: $ seq -s, 6 9; seq --version 6 7,8,9,seq (GNU coreutils) 8.20 ... (nb: newline after the "6", the comma after the 9 and the missing newline) After downgrading to 8.16, I get: $ seq -s, 6 9; seq --version 6,7,8,9 seq (GNU coreutils) 8.16 ... For reference, on a RHEL 5.6, the output is also: $ seq -s, 6 9; seq --version 6,7,8,9 seq (GNU coreutils) 5.97 So to me, it looks as if the speed optimizations in 8.20 broke the "-s" feature of seq. I have recompiled coreutils with the vanilla useflag, which means that no gentoo-specific patches are applied. The attachted text file contains further information (compiler version and flags, etc.). Can anyone reproduce this behavior? Philipp --------------020109010009040002020308 Content-Type: text/plain; name="emerge_info.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="emerge_info.txt" Portage 2.1.11.31 (default/linux/amd64/10.0/desktop, gcc-4.5.4, glibc-2.1= 5-r3, 3.5.7-gentoo x86_64) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D System Settings =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D System uname: Linux-3.5.7-gentoo-x86_64-with-gentoo-2.1 Timestamp of tree: Wed, 19 Dec 2012 07:45:01 +0000 ld GNU ld (GNU Binutils) 2.22 app-shells/bash: 4.2_p37 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.7.3-r2, 3.2.3 dev-util/cmake: 2.8.9 dev-util/pkgconfig: 0.27.1 sys-apps/baselayout: 2.1-r1 sys-apps/openrc: 0.11.8 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.9.6-r3, 1.11.6 sys-devel/binutils: 2.22-r1 sys-devel/gcc: 4.5.4 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.6 (virtual/os-headers) sys-libs/glibc: 2.15-r3 Repositories: gentoo local perl-experimental ACCEPT_KEYWORDS=3D"amd64" ACCEPT_LICENSE=3D"* -@EULA" CBUILD=3D"x86_64-pc-linux-gnu" CFLAGS=3D"-march=3Dnative -mno-avx -O2 -pipe" CHOST=3D"x86_64-pc-linux-gnu" CONFIG_PROTECT=3D"/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK=3D"/etc/ca-certificates.conf /etc/env.d /etc/env.d/ja= va/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebu= ild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/lan= guage.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS=3D"-march=3Dnative -mno-avx -O2 -pipe" DISTDIR=3D"/usr/portage/distfiles" FCFLAGS=3D"-O2 -pipe" FEATURES=3D"assume-digests binpkg-logs config-protect-if-modified distloc= ks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned s= andbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans = userfetch" FFLAGS=3D"-O2 -pipe" GENTOO_MIRRORS=3D"ftp://gentoo.inode.at/source/ ftp://gd.tuwien.ac.at/ops= ys/linux/gentoo/" LANG=3D"en_US.UTF-8" LDFLAGS=3D"-Wl,-O1 -Wl,--as-needed" MAKEOPTS=3D"-j5" PKGDIR=3D"/usr/portage/packages" PORTAGE_CONFIGROOT=3D"/" PORTAGE_RSYNC_OPTS=3D"--recursive --links --safe-links --perms --times --= compress --force --whole-file --delete --stats --human-readable --timeout= =3D180 --exclude=3D/distfiles --exclude=3D/local --exclude=3D/packages" PORTAGE_TMPDIR=3D"/var/tmp" PORTDIR=3D"/usr/portage" PORTDIR_OVERLAY=3D"/usr/local/portage /var/lib/layman/perl-experimental" SYNC=3D"rsync://rsync.at.gentoo.org/gentoo-portage" USE=3D"X a52 aac acl acpi ads aften alsa amd64 bash-completion berkdb blu= etooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups c= xx dbus dmx doc dri dts dvd dvdr eap-tls emacs emboss emerald encode exif= extra ffmpeg firefox flac fontconfig gcj gd gdbm geoip gif gimp gpm gstr= eamer gtk hddtemp iconv icu imagemagick introspection iptc jadetex jpeg k= erberos kpathsea laptop latex lcms ldap libnotify lm_sensors mad minizip = mms mmx mng modules mp3 mp4 mpeg msdoc msppt msxls mudflap multilib ncurs= es network-cron new-login nls nptl oci8-instant-client offensive ogg open= gl openmp oracle pam pam_ssh pango pcre pcsc-lite pdf pdfimport perl pkcs= 11 png policykit postgres ppds pppd python qt3support qt4 readline sdl se= ssion smartcard sna spell sqlite sse sse2 ssh ssl startup-notification su= bversion svg tcpd tex tiff tk truetype udev udisks unicode upower usb vor= bis vpx winbind x264 xcb xft xinerama xml xv xvid zip zlib" ALSA_CARDS=3D= "ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370= ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 triden= t usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS=3D"adpcm alaw = asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladsp= a lfloat linear meter mmap_emul mulaw multi null plug rate route share sh= m softvol" APACHE2_MODULES=3D"actions alias auth_basic authn_alias authn_= anon authn_dbm authn_default authn_file authz_dbm authz_default authz_gro= upfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav= _fs dav_lock deflate dir disk_cache env expires ext_filter file_cache fil= ter headers include info log_config logio mem_cache mime mime_magic negot= iation rewrite setenvif speling status unique_id userdir usertrack vhost_= alias proxy proxy_http" APACHE2_MPMS=3D"prefork" CALLIGRA_FEATURES=3D"kex= i words flow plan sheets stage tables krita karbon braindump" CAMERAS=3D"= ptp2" COLLECTD_PLUGINS=3D"df interface irq load memory rrdtool swap syslo= g" ELIBC=3D"glibc" GPSD_PROTOCOLS=3D"ashtech aivdm earthmate evermore fv1= 8 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver o= ldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate t= nt ubx" INPUT_DEVICES=3D"keyboard mouse evdev" KERNEL=3D"linux" LCD_DEVIC= ES=3D"bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses te= xt" LIBREOFFICE_EXTENSIONS=3D"presenter-console presenter-minimizer" LING= UAS=3D"de en" PHP_TARGETS=3D"php5-3" PYTHON_SINGLE_TARGET=3D"python2_7" P= YTHON_TARGETS=3D"python2_7 python3_2" RUBY_TARGETS=3D"ruby19" USERLAND=3D= "GNU" VIDEO_CARDS=3D"fbdev intel" XTABLES_ADDONS=3D"quota2 psd pknock lsc= an length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit= sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, POR= TAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_R= SYNC_EXTRA_OPTS, USE_PYTHON =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Package Settings =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D sys-apps/coreutils-8.20 was built with the following: USE=3D"acl (multilib) nls vanilla -caps -gmp (-selinux) -static -xattr" --------------020109010009040002020308-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 19 14:01:22 2012 Received: (at 13227) by debbugs.gnu.org; 19 Dec 2012 19:01:22 +0000 Received: from localhost ([127.0.0.1]:51192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlOtM-00049F-Ms for submit@debbugs.gnu.org; Wed, 19 Dec 2012 14:01:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20248) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlOtF-00048z-QX for 13227@debbugs.gnu.org; Wed, 19 Dec 2012 14:01:19 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBJJ18Hq003322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Dec 2012 14:01:08 -0500 Received: from [10.36.116.75] (ovpn-116-75.ams2.redhat.com [10.36.116.75]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBJJ144b000637 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Dec 2012 14:01:07 -0500 Message-ID: <50D20EF0.5070604@draigBrady.com> Date: Wed, 19 Dec 2012 19:01:04 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Philipp Gortan Subject: Re: bug#13227: seq -s broken in coretutils 8.20? References: <50D1F0F3.3040307@gmail.com> In-Reply-To: <50D1F0F3.3040307@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id qBJJ18Hq003322 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13227 Cc: 13227@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) On 12/19/2012 04:53 PM, Philipp Gortan wrote: > Dear coreutils crowd, > > I recently upgraded the coreutils on my Gentoo AMD64 from 8.16 to 8.20. > I used the seq command to generate the values of an SQL "in" statement. > Since I upgraded, the SQL is no longer correct - here is what I found o= ut: > > $ seq -s, 6 9; seq --version > > 6 > 7,8,9,seq (GNU coreutils) 8.20 > ... > > (nb: newline after the "6", the comma after the 9 and the missing newli= ne) > > After downgrading to 8.16, I get: > > $ seq -s, 6 9; seq --version > 6,7,8,9 > seq (GNU coreutils) 8.16 > ... > > For reference, on a RHEL 5.6, the output is also: > > $ seq -s, 6 9; seq --version > 6,7,8,9 > seq (GNU coreutils) 5.97 > > > So to me, it looks as if the speed optimizations in 8.20 broke the "-s" > feature of seq. > > I have recompiled coreutils with the vanilla useflag, which means that > no gentoo-specific patches are applied. The attachted text file contain= s > further information (compiler version and flags, etc.). > > Can anyone reproduce this behavior? Yes confirmed :( Looks like we used puts() in the new code which unconditionally writes a '\n' patch coming up... thanks, P=E1draig. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 19 19:33:21 2012 Received: (at 13227-done) by debbugs.gnu.org; 20 Dec 2012 00:33:21 +0000 Received: from localhost ([127.0.0.1]:51401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlU4d-0003nZ-Ra for submit@debbugs.gnu.org; Wed, 19 Dec 2012 19:33:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31212) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlU4Y-0003nO-VE for 13227-done@debbugs.gnu.org; Wed, 19 Dec 2012 19:33:17 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBK0X8Tm005339 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Dec 2012 19:33:08 -0500 Received: from [10.36.116.75] (ovpn-116-75.ams2.redhat.com [10.36.116.75]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBK0X5rD032557 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 19 Dec 2012 19:33:07 -0500 Message-ID: <50D25CC1.5030702@draigBrady.com> Date: Thu, 20 Dec 2012 00:33:05 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Philipp Gortan Subject: Re: bug#13227: seq -s broken in coretutils 8.20? References: <50D1F0F3.3040307@gmail.com> <50D20EF0.5070604@draigBrady.com> In-Reply-To: <50D20EF0.5070604@draigBrady.com> Content-Type: multipart/mixed; boundary="------------010605020204050801000907" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13227-done Cc: 13227-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This is a multi-part message in MIME format. --------------010605020204050801000907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id qBK0X8Tm005339 On 12/19/2012 07:01 PM, P=E1draig Brady wrote: > On 12/19/2012 04:53 PM, Philipp Gortan wrote: >> Dear coreutils crowd, >> >> I recently upgraded the coreutils on my Gentoo AMD64 from 8.16 to 8.20. >> I used the seq command to generate the values of an SQL "in" statement. >> Since I upgraded, the SQL is no longer correct - here is what I found = out: >> >> $ seq -s, 6 9; seq --version >> >> 6 >> 7,8,9,seq (GNU coreutils) 8.20 >> ... >> >> (nb: newline after the "6", the comma after the 9 and the missing newl= ine) The attached should fix it. thanks, P=E1draig. --------------010605020204050801000907 Content-Type: text/x-patch; name="seq-sep.diff" Content-Disposition: attachment; filename="seq-sep.diff" Content-Transfer-Encoding: 7bit >From 9d9cdfd5df898ade2e680aab5ce37fcd0032c687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Wed, 19 Dec 2012 19:27:10 +0000 Subject: [PATCH] seq: fix newline output when -s specified This regression was introduced in commit v8.19-132-g3786fb6. * src/seq.c (seq_fast): Don't use puts() to output the first number, and instead insert it into the buffer as for other numbers. Also output the terminator unconditionally. * tests/misc/seq.pl: Add some basic tests for the -s option. * NEWS: Mention the fix. * THANKS.in: Reported by Philipp Gortan. --- NEWS | 4 ++++ THANKS.in | 1 + src/seq.c | 20 +++++++++++++------- tests/misc/seq.pl | 5 +++++ 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index e4472df..ae7ec2a 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,10 @@ GNU coreutils NEWS -*- outline -*- the output numbers are properly aligned and of the correct width. [This bug was present in "the beginning".] + seq -s now doesn't output an erroneous newline after the first number, and + outputs a newline after the last number rather than a trailing separator. + [bug introduced in coreutils-8.20] + ** Changes in behavior df --total now prints '-' into the target column (mount point) of the diff --git a/THANKS.in b/THANKS.in index c2651e7..67b60b9 100644 --- a/THANKS.in +++ b/THANKS.in @@ -505,6 +505,7 @@ Phil Richards phil.richards@vf.vodafone.co.uk Philippe De Muyter phdm@macqel.be Philippe Schnoebelen Philippe.Schnoebelen@imag.fr Phillip Jones mouse@datastacks.com +Philipp Gortan gortan@gmail.com Philipp Thomas pth@suse.de Piergiorgio Sartor sartor@sony.de Pieter Bowman bowman@math.utah.edu diff --git a/src/seq.c b/src/seq.c index 9c2c51f..108808b 100644 --- a/src/seq.c +++ b/src/seq.c @@ -419,30 +419,36 @@ seq_fast (char const *a, char const *b) bool ok = cmp (p, p_len, q, q_len) <= 0; if (ok) { - /* Buffer at least this many output lines per fwrite call. + /* Buffer at least this many numbers per fwrite call. This gives a speed-up of more than 2x over the unbuffered code when printing the first 10^9 integers. */ enum {N = 40}; char *buf = xmalloc (N * (n + 1)); char const *buf_end = buf + N * (n + 1); - puts (p); char *z = buf; + + /* Write first number to buffer. */ + z = mempcpy (z, p, p_len); + + /* Append separator then number. */ while (cmp (p, p_len, q, q_len) < 0) { + *z++ = *separator; incr (&p, &p_len); z = mempcpy (z, p, p_len); - *z++ = *separator; - if (buf_end - n - 1 < z) + /* If no place for another separator + number then + output buffer so far, and reset to start of buffer. */ + if (buf_end - (n + 1) < z) { fwrite (buf, z - buf, 1, stdout); z = buf; } } - /* Write any remaining, buffered output. */ - if (buf < z) - fwrite (buf, z - buf, 1, stdout); + /* Write any remaining buffered output, and the terminator. */ + *z++ = *terminator; + fwrite (buf, z - buf, 1, stdout); IF_LINT (free (buf)); } diff --git a/tests/misc/seq.pl b/tests/misc/seq.pl index 447baa4..416b839 100755 --- a/tests/misc/seq.pl +++ b/tests/misc/seq.pl @@ -128,6 +128,11 @@ my @Tests = ['long-leading-zeros2', qw(000 02), {OUT => [qw(0 1 2)]}], ['long-leading-zeros3', qw(00 02), {OUT => [qw(0 1 2)]}], ['long-leading-zeros4', qw(0 02), {OUT => [qw(0 1 2)]}], + + # Exercise the -s option, which was broken in 8.20 + ['sep-1', qw(-s, 1 3), {OUT => [qw(1,2,3)]}], + ['sep-2', qw(-s, 1 1), {OUT => [qw(1)]}], + ['sep-3', qw(-s,, 1 3), {OUT => [qw(1,,2,,3)]}], ); # Append a newline to each entry in the OUT array. -- 1.7.6.4 --------------010605020204050801000907-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 19 20:13:02 2012 Received: (at 13227) by debbugs.gnu.org; 20 Dec 2012 01:13:02 +0000 Received: from localhost ([127.0.0.1]:51420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlUh4-0004n3-Kr for submit@debbugs.gnu.org; Wed, 19 Dec 2012 20:13:02 -0500 Received: from moutng.kundenserver.de ([212.227.17.10]:61137) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlUh2-0004md-G9 for 13227@debbugs.gnu.org; Wed, 19 Dec 2012 20:13:01 -0500 Received: from [192.168.1.11] (p4FC3E64E.dip.t-dialin.net [79.195.230.78]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0Lvg2y-1T2SBk3j1Y-017qtr; Thu, 20 Dec 2012 02:12:53 +0100 Message-ID: <50D26614.4080801@bernhard-voelker.de> Date: Thu, 20 Dec 2012 02:12:52 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: 13227@debbugs.gnu.org, P@draigBrady.com, gortan@gmail.com Subject: Re: bug#13227: seq -s broken in coretutils 8.20? References: <50D1F0F3.3040307@gmail.com> <50D20EF0.5070604@draigBrady.com> <50D25CC1.5030702@draigBrady.com> In-Reply-To: <50D25CC1.5030702@draigBrady.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:idJ++MKtkyR9z/hphBUsNRiPH8jb1hdMXA5zdPQkqC8 97KKS62onHjNLy5VSLRaNGfddJtAb5mPgs3Xktg1eChewxnqcV s33PBmZi4vz34NnuD6gHulIIWKMOJQN0IHG/MCivZl1SH8ofQ4 PVraA1b5II1fD/D+iPWeSCt6Vqb5BEd2OaPOSjXWmi+OiFyGbM mG3iA1SchN8aLymgqP/Xd895ym4EARnxMkUe2gSeEcbgIqsEYE 76OD8G600vFF4+zyTk0GxPF2jB4DOhXYe6OUVpZ++RpkCoQjbK ntCpa5KEAQpJ/3kv1EyRJu8EthRC6ryECU8wX7roL+Vd8tMgw/ jNloF8loUwqnFuRmwwKPCUdt+l3jkH5jC7o2TTYuO X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13227 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) On 12/20/2012 01:33 AM, Pádraig Brady wrote: > The attached should fix it. The patch looks good, thanks. Have a nice day, Berny From unknown Sat Jun 21 03:31:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 17 Jan 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 09 07:35:48 2013 Received: (at control) by debbugs.gnu.org; 9 Jun 2013 11:35:48 +0000 Received: from localhost ([127.0.0.1]:52898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UlduW-0002da-KU for submit@debbugs.gnu.org; Sun, 09 Jun 2013 07:35:48 -0400 Received: from mail3.vodafone.ie ([213.233.128.45]:36118) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UlduU-0002d7-To for control@debbugs.gnu.org; Sun, 09 Jun 2013 07:35:47 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnsDAFpntFFda9Lb/2dsb2JhbAANTYZ2uFGCdgEDHXKDQSpUDQIFFgsCCwMCAQIBOQYCAhUIAQGwdHOQY4EmjHc8fII2gRQDngKOEA Received: from unknown (HELO [192.168.1.79]) ([93.107.210.219]) by mail3.vodafone.ie with ESMTP; 09 Jun 2013 12:35:38 +0100 Message-ID: <51B46889.8040004@draigBrady.com> Date: Sun, 09 Jun 2013 12:35:37 +0100 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: control@debbugs.gnu.org X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: unarchive 13227 unarchive 13493 forcemerge 13227 13493 forcemerge 13227 14584 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [213.233.128.45 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: unarchive 13227 unarchive 13493 forcemerge 13227 13493 forcemerge 13227 14584 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [213.233.128.45 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject unarchive 13227 unarchive 13493 forcemerge 13227 13493 forcemerge 13227 14584 stop From unknown Sat Jun 21 03:31:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 08 Jul 2013 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 12 05:04:47 2013 Received: (at control) by debbugs.gnu.org; 12 Nov 2013 10:04:48 +0000 Received: from localhost ([127.0.0.1]:48129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VgApz-0006gX-JS for submit@debbugs.gnu.org; Tue, 12 Nov 2013 05:04:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:23269) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VgApx-0006gJ-By for control@debbugs.gnu.org; Tue, 12 Nov 2013 05:04:45 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rACA4dfe009680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 12 Nov 2013 05:04:39 -0500 Received: from [10.36.116.41] (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rACA4b0X010807 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 12 Nov 2013 05:04:39 -0500 Message-ID: <5281FD35.7080708@draigBrady.com> Date: Tue, 12 Nov 2013 10:04:37 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: control@debbugs.gnu.org X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) unarchive 14584 forcemerge 14584 15869 stop From unknown Sat Jun 21 03:31:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 10 Dec 2013 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 21 12:28:15 2014 Received: (at control) by debbugs.gnu.org; 21 Mar 2014 16:28:15 +0000 Received: from localhost ([127.0.0.1]:43790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WR2Io-0007mA-Qu for submit@debbugs.gnu.org; Fri, 21 Mar 2014 12:28:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20771) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WR2Il-0007lw-JW for control@debbugs.gnu.org; Fri, 21 Mar 2014 12:28:12 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2LGS9ja011737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 21 Mar 2014 12:28:10 -0400 Received: from [10.36.116.23] (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2LGS7A9026991 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Fri, 21 Mar 2014 12:28:09 -0400 Message-ID: <532C6897.9000109@draigBrady.com> Date: Fri, 21 Mar 2014 16:28:07 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: control@debbugs.gnu.org X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) unarchive 13227 forcemerge 13227 13493 14584 15869 17058 stop From unknown Sat Jun 21 03:31:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 19 Apr 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator