GNU bug report logs - #18439
[PATCH] guile-readline: Use an empty string if HOME is unset

Previous Next

Package: guile;

Reported by: David Michael <fedora.dm0 <at> gmail.com>

Date: Wed, 10 Sep 2014 00:12:02 UTC

Severity: wishlist

Tags: notabug, patch

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: David Michael <fedora.dm0 <at> gmail.com>
Subject: bug#18439: closed (Re: bug#18439: [PATCH] guile-readline: Use the
 current directory if HOME is unset)
Date: Mon, 22 Sep 2014 03:29:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#18439: [PATCH] guile-readline: Use an empty string if HOME is unset

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 18439 <at> debbugs.gnu.org.

-- 
18439: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18439
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mark H Weaver <mhw <at> netris.org>
To: David Michael <fedora.dm0 <at> gmail.com>
Cc: 18439-done <at> debbugs.gnu.org
Subject: Re: bug#18439: [PATCH] guile-readline: Use the current directory if
 HOME is unset
Date: Sun, 21 Sep 2014 23:26:38 -0400
severity 18439 wishlist
tags 18439 notabug
thanks

David Michael <fedora.dm0 <at> gmail.com> writes:

> * guile-readline/ice-9/readline.scm (history-file): When the HOME
>   environment variable is unset, use the current directory instead.
> ---
>  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..df2edaf 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)

Pushed to the stable-2.0 branch, commit
3a3316e200ac49f0e8e9004c233747efd9f54a04.
I'm closing this ticket now.

     Thanks!
       Mark

[Message part 3 (message/rfc822, inline)]
From: David Michael <fedora.dm0 <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: [PATCH] guile-readline: Use an empty string if HOME is unset
Date: Tue, 09 Sep 2014 20:13:33 -0400
* 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



This bug report was last modified 10 years and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.