From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#22027: 25.1.50; Return uncorrupted default string Date: Mon, 5 Jun 2017 09:22:30 +0900 (JST) Message-ID: References: <87poekz9zi.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1496622193 25106 195.159.176.226 (5 Jun 2017 00:23:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Jun 2017 00:23:13 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: Tino Calancha , 22027@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 05 02:23:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHfnX-0006DM-KV for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jun 2017 02:23:07 +0200 Original-Received: from localhost ([::1]:59092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHfnc-0005qf-O6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Jun 2017 20:23:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHfnW-0005qV-61 for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2017 20:23:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHfnS-0002ZU-6N for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2017 20:23:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53584) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHfnS-0002ZC-1G for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2017 20:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dHfnR-0007Tg-PA for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2017 20:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Jun 2017 00:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22027 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 22027-submit@debbugs.gnu.org id=B22027.149662216228719 (code B ref 22027); Mon, 05 Jun 2017 00:23:01 +0000 Original-Received: (at 22027) by debbugs.gnu.org; 5 Jun 2017 00:22:42 +0000 Original-Received: from localhost ([127.0.0.1]:56261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHfn8-0007T9-0K for submit@debbugs.gnu.org; Sun, 04 Jun 2017 20:22:42 -0400 Original-Received: from mail-pg0-f67.google.com ([74.125.83.67]:34925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHfn5-0007St-R2 for 22027@debbugs.gnu.org; Sun, 04 Jun 2017 20:22:40 -0400 Original-Received: by mail-pg0-f67.google.com with SMTP id f127so7836830pgc.2 for <22027@debbugs.gnu.org>; Sun, 04 Jun 2017 17:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=znguNBE1304mhfeE6wJmmDf/tIEq9qjTpO+/DYssAz8=; b=Ovwa4RZxbaSH9dLZATjfsUxSSiEuKG6f4tQ/5GnBrjdp+HEwx7KKD+jhBHRF7YJVOH RdzAfVCF2t1eyG6yIWWppze30QcMCAwyYsNH1WKrkxskSxKbhB/zNZpqUAXIa8Uh5fl5 3hAcqkX9C53KvVmOTdgzIZ22C7Nr022Ge3P8MoCzG/hliSDWSEMsvoCPMKQr4kC9+G3q CPcd7neoHYFeUL+CgUXNo80V+Ej+NXONmZyOutS2oQFWr2jRhBSC1vGAYh0w50cxJBsx stn0OEVRxz+3IABtgnyFRnU7TsRT/eLGn34d0NJVAx0qbj99mCgefu7ewhKogzslsaCH uI9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=znguNBE1304mhfeE6wJmmDf/tIEq9qjTpO+/DYssAz8=; b=QqSJnsgM792oudsKwObSL9IpDhMfviKO7raD0k1BGkkGfu5XQ01fG4OlL/y916nT0j cp4zVbzM8xoQerFq8qCLr5k4LYRJh7zkN3mhq4YlJr+fSpW4EyjKlvHYu5C9WRsi69q6 yGN4YhLOcGGsFiQn4dyFBAEOIvz3wht3dF2cKHl+u3EDZpbkdTYq6ls4DtXdpZemVVYM RQj7zybX55DJ9pZBKsfqNVJ90VfuBzmpI4WZA9orWTReygI+0AO4Hf0P0xlDPkOmYK1t 2rBlkt6Rf0O/BE1tprV6hzw+HuDLTnp6P16qwV2brlBaufiPqJjtEf0T4EUYX3PORK3n geyQ== X-Gm-Message-State: AODbwcAHhfs2GQ3+hcYupGm4RhcAhu6EYRHRTl1G/yzXz+LZtq1xwRUj YIvmMW3QyLYkZg== X-Received: by 10.84.241.132 with SMTP id b4mr12196171pll.107.1496622153821; Sun, 04 Jun 2017 17:22:33 -0700 (PDT) Original-Received: from calancha-pc (222.139.137.133.dy.bbexcite.jp. [133.137.139.222]) by smtp.gmail.com with ESMTPSA id n20sm6350241pfi.127.2017.06.04.17.22.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Jun 2017 17:22:33 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <87poekz9zi.fsf@users.sourceforge.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133273 Archived-At: On Sat, 3 Jun 2017, npostavs@users.sourceforge.net wrote: > Tino Calancha writes: > >> + (setq success (copy-sequence first)) >> + (when (and (arrayp first) >> + (not (string= first ""))) >> + (clear-string first) >> + (clear-string second))) > > I think that is too complicated, how about this instead: Yes, your is better. Thank you. We might add a test as well: commit eb7fdeefadf08d7a781bee60df45fb045b582930 Author: Tino Calancha Date: Mon Jun 5 09:18:55 2017 +0900 * test/lisp/subr-tests.el (subr-tests-bug22027): Add test. diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index c0bfd40f80..81f61220d3 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -28,6 +28,7 @@ ;;; Code: (require 'ert) +(eval-when-compile (require 'cl-lib)) (ert-deftest let-when-compile () ;; good case @@ -316,5 +317,13 @@ subr-tests--this-file (should-not (method-files 'subr-tests--undefined-generic)) (should-not (method-files 'subr-tests--generic-without-methods))) +(ert-deftest subr-tests-bug22027 () + "Test for http://debbugs.gnu.org/22027 ." + (cl-letf* ((default "foo") + ((symbol-function 'read-string) + (lambda (&rest args) (mapconcat #'string default "")))) + (should (string= default (read-passwd "pass: " 'confirm default))))) + + (provide 'subr-tests) ;;; subr-tests.el ends here