From owner-svn-src-head@freebsd.org Thu Aug 16 15:30:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29D0A106ABE0; Thu, 16 Aug 2018 15:30:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AE4488359; Thu, 16 Aug 2018 15:30:10 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-x229.google.com with SMTP id v9-v6so3995031ljk.4; Thu, 16 Aug 2018 08:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OBx9N67KF0+jbr5b2KoSmmOgbWXSNGoGUSIAsmxuomM=; b=eqYk4peadb33H66r8XzmzNYEe6Uv7Nrxi6A+46aTo/T9mDhWNjKC5AGfILlI0bHjd4 p0fpEWWfCZtGWbfnCbjElQBNy41VVzRdlCJwpMfeHs3S1GqhXEbcWxRdDdSrTlfUBNJC AtNKc+LxyivR8461PcKd5IybPFCjWCbPD0hsG7ze7ntZTpHYGK3ErhFxxkAmJvlw5YWP T2NiDXKGerG8rFdcknJ9Q81C1i455Kyf4WBxXbFO4IbaRYh4scPWt20vwARDfPdBU6Hw A8bA864vtw9OJFyIuEksx17FBbzTG+bp98WsAVg6uVBhHdNE6lFbG43mJgNXHe5lzuCk UzzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OBx9N67KF0+jbr5b2KoSmmOgbWXSNGoGUSIAsmxuomM=; b=RN1iUJwqNeIoLb5YkSvgbvVIIiozAJTDmbMbV6HVS93057I39FJ2FpqpoJbSEwVLa0 nFRsbzEJjg20SNAkUeHCenW4oG6FJ1dxMjw+4C8hM5WOs8D4/UvbAW8xA+nuyYaXNBWu hV1uETHruCafvq09n1bjqzay7UIFRjei12P4N19gQ6HSJn8hq53Ezqml84raVL5JUpye EA+t94MFHhvegaFeBG26iGPSu/rWqT7YWpXOREarjK6ge5CG49sgDJN+rRQ5OqUno/F3 VrnR2/55Yf43fbbR7NirnS8KsjxDLPfC6STidFDgHGk6uj5rGlVSzQ4q0jYBmt6Rdhc7 RHzg== X-Gm-Message-State: AOUpUlHUYomr0ggAlrUOgMbjWTcluxL7XiZx919aXhx9fC01ppYjR7RG IpfgC5jAVTtiMkPA8qVGWUJY1X5wlHnaPY86anOG/o+P X-Google-Smtp-Source: AA+uWPxQx8XsLh3pe2zKdJt/qEq54gWQqpUeZupJfne7JeD4gAdoG4WblImW2oCg++3ch0XLMHOcqo6Abz1XnkGoFsg= X-Received: by 2002:a2e:7815:: with SMTP id t21-v6mr5465430ljc.61.1534433408460; Thu, 16 Aug 2018 08:30:08 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 2002:ab3:7851:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 08:30:07 -0700 (PDT) In-Reply-To: <201808071447.w77Eld3I069906@repo.freebsd.org> References: <201808071447.w77Eld3I069906@repo.freebsd.org> From: Alan Somers Date: Thu, 16 Aug 2018 09:30:07 -0600 X-Google-Sender-Auth: cndtvQ-oBZuJrH3NG4JLkbHB6FI Message-ID: Subject: Re: svn commit: r337419 - head/usr.bin/sed To: "Pedro F. Giffuni" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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: Thu, 16 Aug 2018 15:30:11 -0000 On Tue, Aug 7, 2018 at 8:47 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Aug 7 14:47:39 2018 > New Revision: 337419 > URL: https://svnweb.freebsd.org/changeset/base/337419 > > Log: > sed(1): partial fix for the case of the regex delimited with '['. > > We don't generally support the weird case of regular expresions delimited > by an opening square bracket ('[') but POSIX says that inside > bracket expressions, escaping is not possible and both '[' and '\' > represent themselves. > > PR: 230198 (exp-run) > Obtained from: OpenBSD > > Modified: > head/usr.bin/sed/compile.c > > Modified: head/usr.bin/sed/compile.c > ============================================================ > ================== > --- head/usr.bin/sed/compile.c Tue Aug 7 14:39:00 2018 (r337418) > +++ head/usr.bin/sed/compile.c Tue Aug 7 14:47:39 2018 (r337419) > @@ -393,11 +393,11 @@ compile_delimited(char *p, char *d, int is_tr) > if ((d = compile_ccl(&p, d)) == NULL) > errx(1, "%lu: %s: unbalanced brackets > ([])", linenum, fname); > continue; > + } else if (*p == '\\' && p[1] == c) { > + p++; > } else if (*p == '\\' && p[1] == '[') { > *d++ = *p++; > - } else if (*p == '\\' && p[1] == c) > - p++; > - else if (*p == '\\' && p[1] == 'n') { > + } else if (*p == '\\' && p[1] == 'n') { > *d++ = '\n'; > p += 2; > continue; > > This change seems to have caused a regression in multi_test.sh. https://ci.freebsd.org/job/FreeBSD-head-amd64-test/8630/testReport/usr.bin.sed/multi_test/main/