From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add shell-quasiquote. Date: Sat, 17 Oct 2015 19:14:16 +0200 Message-ID: <87fv19wh7b.fsf@T420.taylan> References: <87si59wj42.fsf@T420.taylan> <83eggt4esi.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445102080 16215 80.91.229.3 (17 Oct 2015 17:14:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Oct 2015 17:14:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 17 19:14:34 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZnV3y-0003N8-9J for ged-emacs-devel@m.gmane.org; Sat, 17 Oct 2015 19:14:34 +0200 Original-Received: from localhost ([::1]:59202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnV3x-0000Rs-6S for ged-emacs-devel@m.gmane.org; Sat, 17 Oct 2015 13:14:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnV3j-0000Rn-TZ for emacs-devel@gnu.org; Sat, 17 Oct 2015 13:14:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnV3j-0002ok-4V for emacs-devel@gnu.org; Sat, 17 Oct 2015 13:14:19 -0400 Original-Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:38099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnV3i-0002oc-VX; Sat, 17 Oct 2015 13:14:19 -0400 Original-Received: by wicll6 with SMTP id ll6so49074517wic.1; Sat, 17 Oct 2015 10:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=Y4ndf2StCWy27cumbx+h+LivQnAOfuILW/qOeA11WiI=; b=G3Kjr1FbNkQHOCEKWVT1upT6r9CI4p1P9rcX50W3IvHfQFsO2Jjdx2zq9d5zWNoMjM OGB48R5jjNNO+8S4kxGWbkdWyKN363oXL5jZsAQeR7Hmg+gAWq106EFZVrycNjMwZXdt tioXZvtnoV3R4jVV/dQirZIL32w3bFWB3YyzgXJ4sNSv+r/p8GPpsSzqQpA87cp2sY/+ gf2ZMXy/xZY0t+5OhAAZlp3ado0n1Hl4joUZ3ubkZz+dOD3P5zaIQGxFHgDgjtZbPrpN OFvaVSo2PnnNeGhUTxr4ez0bR3HXfWr0mpuuNfnqjPOMij2a/zyDhaiky3WADdWEwzp4 2ZAw== X-Received: by 10.180.103.199 with SMTP id fy7mr11428807wib.85.1445102058233; Sat, 17 Oct 2015 10:14:18 -0700 (PDT) Original-Received: from T420.taylan ([2a02:908:c32:4740:221:ccff:fe66:68f0]) by smtp.gmail.com with ESMTPSA id hs5sm7811898wib.6.2015.10.17.10.14.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Oct 2015 10:14:17 -0700 (PDT) In-Reply-To: <83eggt4esi.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 17 Oct 2015 19:53:49 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:191857 Archived-At: Eli Zaretskii writes: >> +;;; Like `shell-quote-argument', but much simpler in implementation. >> +(defun shqq--quote-string (string) >> + (concat "'" (replace-regexp-in-string "'" "'\\\\''" string) "'")) > > It might be simpler, but it's wrong, because the result is only > correct for Posix shells. > > Please do use shell-quote-argument instead. Hmm, I don't really want to take responsibility of my library being used with shells other than POSIX shells. (The library could make that clearer and error on other systems.) How much can I rely on shell-quote-argument? Can one fully rely on it being safe against code injection? Taylan