From patchwork Wed Nov 12 13:59:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 419627 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C8C411400A0 for ; Wed, 10 Dec 2014 23:21:29 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 415C628C1DE; Wed, 10 Dec 2014 13:16:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, DATE_IN_PAST_96_XX, FREEMAIL_FROM,T_DKIM_INVALID autolearn=no version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 55AB028C1DD for ; Wed, 10 Dec 2014 13:16:26 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -8.5 Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Wed, 10 Dec 2014 13:16:24 +0100 (CET) Received: by mail-pa0-f45.google.com with SMTP id lf10so2108972pab.32 for ; Wed, 10 Dec 2014 04:18:04 -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:in-reply-to:references; bh=qt8okLJf35Gn4t3FllsNPm0wlIP2krtujKPNhZVImWM=; b=lH0CHC4r8wGKzLQMqM4uWwCMiXtlVRG0kX6pOKG02z6SEUSgIzE/cZ8XXtO6+PZZ/t WOu9G/cHa/rSoJ9qkta+nH6xlsg/p4Qcr14aKQzaNQvXsOI0ZUgyjgRVgqjiYJANhuib 3VQA6aGBOUFAGrVVQnsVvDaBHGERahW1cc/7YDurDEju+Y7UTNtsd+Vl/01f3kqelT/r oAx7LG8M4BSRzJfeDxglAzd53ZaMgfehdPgcM9vHkGO/wkiNR29h14f+ykhqRZQLD34S I4fe8OmOIqrvpoaIvcOP2Ci8QdRL14vZwg2zYarhM9opLQHJtKj4KoAcMZAutupBDK9N izkA== X-Received: by 10.66.254.232 with SMTP id al8mr6677677pad.76.1418213883717; Wed, 10 Dec 2014 04:18:03 -0800 (PST) Received: from debian.lan ([103.29.140.56]) by mx.google.com with ESMTPSA id hc10sm4063709pbd.78.2014.12.10.04.18.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Dec 2014 04:18:02 -0800 (PST) From: Yousong Zhou To: nbd@openwrt.org Date: Wed, 12 Nov 2014 21:59:21 +0800 Message-Id: <1415800763-14311-9-git-send-email-yszhou4tech@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1415800763-14311-1-git-send-email-yszhou4tech@gmail.com> References: <1415800763-14311-1-git-send-email-yszhou4tech@gmail.com> Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH v2 08/10] json_script: fix logic invert of handle_expr_not(). X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Yousong Zhou --- json_script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json_script.c b/json_script.c index 0ec7b38..0d51f79 100644 --- a/json_script.c +++ b/json_script.c @@ -338,7 +338,7 @@ static int handle_expr_not(struct json_call *call, struct blob_attr *expr) if (!tb[1]) return -1; - return json_process_expr(call, tb[1]); + return !json_process_expr(call, tb[1]); } static const struct json_handler expr[] = {