From patchwork Mon Apr 6 02:30:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 6162761 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9873BBF4A6 for ; Mon, 6 Apr 2015 02:31:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D104C20450 for ; Mon, 6 Apr 2015 02:31:14 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BDAF820392 for ; Mon, 6 Apr 2015 02:31:12 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AF48A2614D0; Mon, 6 Apr 2015 04:31:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 5B0432614A9; Mon, 6 Apr 2015 04:31:03 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id ED7DE2614A9; Mon, 6 Apr 2015 04:31:01 +0200 (CEST) Received: from smtp310.phy.lolipop.jp (smtp310.phy.lolipop.jp [210.157.22.78]) by alsa0.perex.cz (Postfix) with ESMTP id D02A9261498; Mon, 6 Apr 2015 04:30:54 +0200 (CEST) Received: from smtp310.phy.lolipop.lan (HELO smtp310.phy.lolipop.jp) (172.17.1.10) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp310.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Mon, 06 Apr 2015 11:30:52 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp310.phy.lolipop.jp (LOLIPOP-Fsecure); Mon, 06 Apr 2015 11:30:50 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) From: Takashi Sakamoto To: tiwai@alsa-project.org, perex@perex.cz Date: Mon, 6 Apr 2015 11:30:50 +0900 Message-Id: <1428287450-3665-1-git-send-email-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH/alsa-lib] amixer: fix 'cset' operation to set several channels X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP For an enumerated element with several channels, when given comma-separated string values, 'cset' operation sets these values just to the first channel, instead of corresponding channels. This commit adds missing-increment to fix this bug. Signed-off-by: Takashi Sakamoto --- amixer/amixer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/amixer/amixer.c b/amixer/amixer.c index 36c92eb..e9fe735 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -1290,8 +1290,10 @@ static int sset_enum(snd_mixer_elem_t *elem, unsigned int argc, char **argv) if (snd_mixer_selem_set_enum_item(elem, item++, ival) >= 0) check_flag = 1; /* skip separators */ - while (*ptr == ',' || isspace(*ptr)) + while (*ptr == ',' || isspace(*ptr)) { ptr++; + chn++; + } } } return check_flag;