From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 7C64C7AE85 for ; Fri, 17 Apr 2015 05:51:19 -0700 (PDT) Received: by wizk4 with SMTP id k4so20588601wiz.1 for ; Fri, 17 Apr 2015 05:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=DEnOyFExX5Fzr1tQJaYDGhbJutHnB7HH3wbWckqAJRM=; b=pO3AKdU/KTIToIvVcnJdwjLVmh6N0uH0Nb2Bu4M66U0fDB+A7bVIFdaXaxKk0+Zi7s IYOgdiXDO0FwLFIN2Ji0J9SXBtR5ec7lm+OGH8G+tFcibDd1minDqgZEsDc2eQlZHoF2 k/ihl8RtGz2R3tjafFW3ijtpCXJNy0mt57tL+gxFl3xthAbFdgMfQHkVGreIzmjzl0sp fP6yVJj0r3WonTfHyZ2sGnKukDP7ge2aBoGfRh3WflD+svGVt1N174PCJ4sq5poeKNc7 U5HrUpq2AnuJyE7/M5j1BoIjzjkSJh1xbSSyip003ZkaM3bl03x26PcorNgpR/tc/AN8 RmEg== X-Received: by 10.194.110.233 with SMTP id id9mr5715312wjb.136.1429275014974; Fri, 17 Apr 2015 05:50:14 -0700 (PDT) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by mx.google.com with ESMTPSA id l3sm2526583wiv.18.2015.04.17.05.50.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 05:50:14 -0700 (PDT) Date: Fri, 17 Apr 2015 13:50:02 +0100 From: Adam Thompson To: Karl Dahlke Message-ID: <20150417125002.GA14517@toaster.adamthompson.me.uk> References: <20150316174053.eklhad@comcast.net> <20150417071243.GB5949@toaster.adamthompson.me.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PEIAKu/WMn1b1Hv9" Content-Disposition: inline In-Reply-To: <20150417071243.GB5949@toaster.adamthompson.me.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Edbrowse-dev@lists.the-brannons.com Subject: Re: [Edbrowse-dev] wordexp again X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 12:51:20 -0000 --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 17, 2015 at 08:12:43AM +0100, Adam Thompson wrote: > On Thu, Apr 16, 2015 at 05:40:53PM -0400, Karl Dahlke wrote: > > I made one common routine to protect a file name or directory name from > > shell expansion, it's the same code I was using before, but now it is s= hared > > between the directory scan and the plugin commands. > > Ok, that's good software practice, but it exposed a bug > > that I think was there all along. > > You can't edit a directory with a backslash in it. > >=20 > > mkdir "a\\b" > > cd a?b > > touch foo bar > > cd .. > > edbrowse a?b > >=20 > > Try it before or after my latest push. > > The files therein just don't show up, > > because wordexp doesn't expand a\\b/* properly. > > and that is the proper escaping. > > At the shell prompt > > ls a\\b/* > > works fine. > > And it all works through the plugin system, i.e. a\b.pdf becomes > > pdftohtml a\\b.pdf > > This seems to be a bug in wordexp, at least my wordexp, > > and I'm really not sure what to do about it. Actually we broke things when doing wordexp implementation. Basically the "quick check" in envFile is just wrong and needs to go since = it doesn't work correctly and doesn't include all corner cases. Whilst looking at this I also noticed that ~username/whatever was also not expanded due to this "quick check". Removing the check fixes this bug and probably makes the behaviour much more consistant into the bargain (i.e. ` suppresses it, otherwise we get wordexp expansion). Once I get the readline completion using the shellProtect routine I'll push= the fix. Cheers, Adam. --PEIAKu/WMn1b1Hv9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVMQF6AAoJELZ22lNQBzHOFbsIAKTdA1Z3GRu21c9IIblhR84k 0WrI44wOOS4SeAhKd1YXr8a6AjWmvVtVIwuG0j1tItY72oANGyczJ1c5uVHQ9wmO 5tj2dfFzGNjdqu4oJQxmc27wLgKirDgsqAMTIBIlQZfncJmkbrsOKBguDOtQBror WXVI2A4MrM4XEXH7fkrocsXvwNT0maTekKfF4dy61bR2z2Vn+WD7xSnA4ffeshsR GWJ+FFxd8YhBouvWaADg/f/DoL/cNKz2CbQ0aUvla+2YG1sqnDx3U/c3ZD6wSwdc gEbZYnTvXz84UNz+gCbck+HLxwKZJR2r5hgw3B7HRAbUoAEQgCbq30w/JXmLjBU= =NffP -----END PGP SIGNATURE----- --PEIAKu/WMn1b1Hv9--