From patchwork Thu Aug 4 05:54:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kylie McClain X-Patchwork-Id: 9262721 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE17B6048F for ; Thu, 4 Aug 2016 06:11:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95EF627F9C for ; Thu, 4 Aug 2016 06:11:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A69D280F4; Thu, 4 Aug 2016 06:11:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1426827F9C for ; Thu, 4 Aug 2016 06:11:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750779AbcHDGLl (ORCPT ); Thu, 4 Aug 2016 02:11:41 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34565 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbcHDGLj (ORCPT ); Thu, 4 Aug 2016 02:11:39 -0400 Received: by mail-qt0-f194.google.com with SMTP id c52so12322633qte.1 for ; Wed, 03 Aug 2016 23:11:16 -0700 (PDT) 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=i0WZ0/g1D3ZT9tJKeg0ZEbyniEUGISZLLjcGxgpg/B0=; b=J37FqZoDtIq8m26MZ0LDHxTzmChoZb6YBsD5IV6PSaWVOOea9I2/ZoHz20x/Wnc894 bozlheOO6OJn8gBufFn1qhr3VcNrCBVvtBRIuhRuf0li1znJq1BNSLk0L4OtWMa6nGv1 ve4vVYxdJSsSTOimP2Z5ST5MU5apnH2SDdnZseVqqADQ09+w8tRyhT7dR+npZ5uRHWz4 iMnKeITpZd/WFKR8udegurckVb9G/Kv5TsJ46Sr3zrtuV7OLqVTbGUQl3eeKG4HVaS49 DMtPo+z1stbfSKv9qochsWoc+VIgRs1/sH/PBKdGOFf7YRC4/5oCP4y5hzthSv8Bj0VF 9gqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i0WZ0/g1D3ZT9tJKeg0ZEbyniEUGISZLLjcGxgpg/B0=; b=cGdiX1Ndr1hohNvbiPKfJCfXDXaSSOCy8p9oSkaNbrpQE2JyW4TqOSMPRfG1p6tNzc MnJlKWBrNIH5ur429IHZITtx1zMzhWj4dNkaJ4NC9G4q0mI8VmK01vDvMxM76nZHpKnu fNsQI2+QQv2TZSXWUIhEJ1g+CdmBhxVCGo8Nj/ZzGYzplB4aL2CcjTnhoecgViIlvt4R /ilVvRpwBvZefAgQtg6U1YW+h8kB7wBUlUQ+x8b2Dh8BylWuTfOEFtHFPdfSWNVMXqHh 7LCvL/AjG6sgkH9y9gKrGHWdMtKB4bWb6pvo1N4hj9MhIULCUl8KJmL+0DPGQ5fIc9+K Sn+g== X-Gm-Message-State: AEkoousf4X5WSXSj5Oi0o/lXGPK1Z+osCq2+uwMBsmz4z0xsqeLQLuLI33z9j4JI26xGyA== X-Received: by 10.200.35.44 with SMTP id a41mr4264464qta.25.1470290056783; Wed, 03 Aug 2016 22:54:16 -0700 (PDT) Received: from localhost.localdomain (cpe-65-184-25-62.carolina.res.rr.com. [65.184.25.62]) by smtp.gmail.com with ESMTPSA id u44sm6122888qtc.27.2016.08.03.22.54.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Aug 2016 22:54:16 -0700 (PDT) From: Kylie McClain To: dash@vger.kernel.org Cc: Kylie McClain Subject: [PATCH 2/2] histedit: Remove non-glibc fallback code Date: Thu, 4 Aug 2016 01:54:11 -0400 Message-Id: <20160804055411.23558-2-somasissounds@gmail.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160804055411.23558-1-somasissounds@gmail.com> References: <20160804055411.23558-1-somasissounds@gmail.com> Sender: dash-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kylie McClain This fallback code seems to go back the import of the repository back in 2005, it fails on musl libc, and there aren't any comments explaining why this difference is needed. Regardless, any compatibility ifdefs should probably be checking macros defined on systems that need a different code path, rather than just having fallback code for non-glibc. --- src/histedit.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/histedit.c b/src/histedit.c index 94465d7..4498cf4 100644 --- a/src/histedit.c +++ b/src/histedit.c @@ -214,11 +214,7 @@ histcmd(int argc, char **argv) if (argc == 1) sh_error("missing history argument"); -#ifdef __GLIBC__ optind = 0; -#else - optreset = 1; optind = 1; /* initialize getopt */ -#endif while (not_fcnumber(argv[optind]) && (ch = getopt(argc, argv, ":e:lnrs")) != -1) switch ((char)ch) {