all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Juanma Barranquero" <lekktu@gmail.com>
To: "Vincent Liard" <vincent.liard@free.fr>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: Crash on empty HOME var in Windows registry
Date: Mon, 18 Jun 2007 14:15:31 +0200	[thread overview]
Message-ID: <f7ccd24b0706180515o2b9e8dd0rd18715b762336819@mail.gmail.com> (raw)
In-Reply-To: <46764C61.1050804@free.fr>

On 6/18/07, Vincent Liard <vincent.liard@free.fr> wrote:

> having an empty HOME string value at this place causes emacs to
> crash at start.

In fact Emacs is not crashing, but aborting because it doesn't have a
valid HOME value in its environment. It's a check.

It could be fixed with the simple patch below, which forces
environment variables coming from the registry to have non-null values
(else they get the default value).

I'm not sure whether is the right thing to do, though: first, because
a null HOME or SHELL in the registry is likely an error; and second,
because I'm not sure it makes sense for other environment variables to
have null values on the registry.

Jason?

             Juanma


Index: src/w32.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32.c,v
retrieving revision 1.113
diff -u -2 -r1.113 w32.c
--- src/w32.c	14 Jun 2007 15:58:13 -0000	1.113
+++ src/w32.c	18 Jun 2007 12:07:47 -0000
@@ -1156,5 +1156,6 @@
 	    int dont_free = 0;

-	    if ((lpval = w32_get_resource (env_vars[i].name, &dwType)) == NULL)
+	    if ((lpval = w32_get_resource (env_vars[i].name, &dwType)) == NULL
+		|| *lpval == 0)
 	      {
 		lpval = env_vars[i].def_value;

  reply	other threads:[~2007-06-18 12:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-18  9:12 Crash on empty HOME var in Windows registry Vincent Liard
2007-06-18 12:15 ` Juanma Barranquero [this message]
2007-06-18 12:47   ` Vincent Liard
2007-06-18 13:05     ` Juanma Barranquero
2007-06-18 15:19   ` Jason Rumney
2007-06-18 16:43     ` Juanma Barranquero
2007-06-18 21:04       ` Jason Rumney
2007-06-18 21:23         ` Lennart Borgman (gmail)
2007-06-18 21:35           ` Juanma Barranquero
2007-06-18 21:49             ` Lennart Borgman (gmail)
2007-06-18 22:01               ` Jason Rumney
2007-06-18 22:24                 ` Lennart Borgman (gmail)
2007-06-19 10:40 ` Richard Stallman
2007-06-19 11:45   ` Juanma Barranquero
2007-06-19 11:51   ` Vincent Liard
2007-06-19 12:00     ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7ccd24b0706180515o2b9e8dd0rd18715b762336819@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=vincent.liard@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.