From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id DB488431FBF for ; Sun, 9 Dec 2012 04:56:49 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.201 X-Spam-Level: X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w9kUPnaIO5WK for ; Sun, 9 Dec 2012 04:56:48 -0800 (PST) Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E004C431FC3 for ; Sun, 9 Dec 2012 04:56:47 -0800 (PST) Received: by mail-wg0-f41.google.com with SMTP id ds1so438076wgb.2 for ; Sun, 09 Dec 2012 04:56:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=SsdrJwL36NiGyAsGs57IupUZTUuYpj+YBbCYkXP9Aec=; b=u4x/8U9nyPs1kABN51l38inzoOuBR6qQ/sGDZ91gMYQm1NdpTvsTeNMwGOSrakWElA YBQnimRdiSHg/jJwJ1lMTm1gota8qGKy5ZKEP3AGsKGi4BuZo8upFbdduHi0QMXjWiWn HdYG9w9B0J2jf+vQ/vmeyItIolo8rN90PP0JA3cfHIrAxoavClaOSDBV2nuKpXGpm50X rhFgw14PBh08cgmb2364MAMsTBZFt0QXIqGOpp2BSeaiiv0rD0nveYsZdbOltiABGhiA yDKFrjZeTVF8YyXhxrLuny/QvTgDjaxuby66RkLVP8a0p1LrtySUu/W7DHKS3euFPa20 xqqg== Received: by 10.216.207.104 with SMTP id m82mr4245808weo.4.1355057805797; Sun, 09 Dec 2012 04:56:45 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id i6sm5863109wix.5.2012.12.09.04.56.42 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Dec 2012 04:56:42 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v4 1/3] test: normalize only message filenames in show json Date: Sun, 9 Dec 2012 12:56:34 +0000 Message-Id: <1355057796-19260-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1355057796-19260-1-git-send-email-markwalters1009@gmail.com> References: <1355057796-19260-1-git-send-email-markwalters1009@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 12:56:50 -0000 From: Peter Wang notmuch_json_show_sanitize replaced "filename" field values even in part structures, where the value is predictable. Make it only normalize the filename value if it is an absolute path (begins with slash), which is true of the Maildir filenames that were intended to be normalized away. --- test/multipart | 2 +- test/test-lib.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/multipart b/test/multipart index 0527f84..344ed81 100755 --- a/test/multipart +++ b/test/multipart @@ -630,7 +630,7 @@ cat <EXPECTED "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}, {"id": 7, "content-type": "text/plain", - "filename": "YYYYY", + "filename": "attachment", "content": "This is a text attachment.\n"}, {"id": 8, "content-type": "text/plain", diff --git a/test/test-lib.sh b/test/test-lib.sh index fd64736..6ce3b31 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -600,7 +600,7 @@ notmuch_json_show_sanitize () { sed \ -e 's|"id": "[^"]*",|"id": "XXXXX",|g' \ - -e 's|"filename": "[^"]*",|"filename": "YYYYY",|g' + -e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g' } # End of notmuch helper functions -- 1.7.9.1