From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Michael Newsgroups: gmane.lisp.guile.bugs Subject: bug#18439: [PATCH] guile-readline: Use an empty string if HOME is unset Date: Tue, 09 Sep 2014 20:13:33 -0400 Message-ID: <87lhpsbadu.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410332955 23044 80.91.229.3 (10 Sep 2014 07:09:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Sep 2014 07:09:15 +0000 (UTC) To: 18439@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Sep 10 09:09:08 2014 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XRc1a-0008Rq-Iv for guile-bugs@m.gmane.org; Wed, 10 Sep 2014 09:09:06 +0200 Original-Received: from localhost ([::1]:53929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRc1a-00036s-0S for guile-bugs@m.gmane.org; Wed, 10 Sep 2014 03:09:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRVW8-0002NY-4Z for bug-guile@gnu.org; Tue, 09 Sep 2014 20:12:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRVVz-0003f1-4W for bug-guile@gnu.org; Tue, 09 Sep 2014 20:12:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRVVz-0003ew-06 for bug-guile@gnu.org; Tue, 09 Sep 2014 20:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XRVVy-0003ZU-KI for bug-guile@gnu.org; Tue, 09 Sep 2014 20:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Michael Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 10 Sep 2014 00:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18439 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141030788213659 (code B ref -1); Wed, 10 Sep 2014 00:12:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Sep 2014 00:11:22 +0000 Original-Received: from localhost ([127.0.0.1]:35778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XRVVJ-0003YC-Eh for submit@debbugs.gnu.org; Tue, 09 Sep 2014 20:11:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38475) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XRVVH-0003Xp-F2 for submit@debbugs.gnu.org; Tue, 09 Sep 2014 20:11:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRVV3-0003KE-4d for submit@debbugs.gnu.org; Tue, 09 Sep 2014 20:11:14 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:49731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRVV3-0003K8-1F for submit@debbugs.gnu.org; Tue, 09 Sep 2014 20:11:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRVUt-0002IM-P2 for bug-guile@gnu.org; Tue, 09 Sep 2014 20:11:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRVUk-00037x-Ij for bug-guile@gnu.org; Tue, 09 Sep 2014 20:10:55 -0400 Original-Received: from mail-qc0-x22c.google.com ([2607:f8b0:400d:c01::22c]:65014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRVUk-00037Y-E1 for bug-guile@gnu.org; Tue, 09 Sep 2014 20:10:46 -0400 Original-Received: by mail-qc0-f172.google.com with SMTP id o8so18203379qcw.17 for ; Tue, 09 Sep 2014 17:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=ZAGtRF2oUr9601jkhi3uyu7BZQf5vYnXN0pUoB8WTh8=; b=efuNfoYc5Ts+GCkqZVDrfLblBkkQKItdJRTRfEU1vjJ2p4DeQiYorv8f9ISfWNkwpn MqMfdpgGf4WwDBU8XlM4ujDDjVENesmP0JdrDQMfqA0Ce40vYfHOr7a/IWM2SAI3e9H/ LjNQHetl651IKgqXEJYY2/LPi87dukouIi/MazBX4wcqGuamRhGbbjzwfoaoZ04Dpg61 Mlb1cBkyCiTLhECyBUDmY169WPnB9w93RGSwAMl/WPxKo1YvwTolAW/esMwlJ4V3De1O OkZGKQ+NYyAGphm5z4AIJ8fLPRZbozqa76fh6BTOtxRnNNaMhTpDDCQic8wf/vTJSc0v cZBg== X-Received: by 10.229.59.67 with SMTP id k3mr55776756qch.26.1410307842158; Tue, 09 Sep 2014 17:10:42 -0700 (PDT) Original-Received: from callisto (c-68-81-204-146.hsd1.pa.comcast.net. [68.81.204.146]) by mx.google.com with ESMTPSA id o92sm5127493qgd.0.2014.09.09.17.10.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Sep 2014 17:10:41 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Wed, 10 Sep 2014 03:09:02 -0400 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7544 Archived-At: * guile-readline/ice-9/readline.scm (history-file): When the HOME environment variable is unset, use the empty string in its place. --- Hi, If a Guile program uses the readline module without setting HOME, it will fail due to string-append getting a #f argument. In particular, this necessitates workarounds when starting GNU dmd early in the boot process. To illustrate this, try: guile -c '(use-modules (ice-9 readline))(display "working\n")' And then: env -u HOME \ guile -c '(use-modules (ice-9 readline))(display "working\n")' Let me know if there is a better alternative for handling this case, and I can send another patch. Thanks. David guile-readline/ice-9/readline.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guile-readline/ice-9/readline.scm b/guile-readline/ice-9/readline.scm index 02e68af..0979fd3 100644 --- a/guile-readline/ice-9/readline.scm +++ b/guile-readline/ice-9/readline.scm @@ -119,7 +119,8 @@ (define-once the-readline-port #f) (define-once history-variable "GUILE_HISTORY") -(define-once history-file (string-append (getenv "HOME") "/.guile_history")) +(define-once history-file + (string-append (or (getenv "HOME") "") "/.guile_history")) (define-public readline-port (let ((do (lambda (r/w) -- 1.9.3