[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash on empty HOME var in Windows registry

From: Vincent Liard
Subject: Re: Crash on empty HOME var in Windows registry
Date: Mon, 18 Jun 2007 14:47:26 +0200
User-agent: Thunderbird (Windows/20070509)

> 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.

As for me, I have switched to the solution of using a HOME environment var, anyway. And I agree on you view for the content of the registry entry.

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.

At first, I get an emacs notification error "A fatal error has occurred! Select Abort to exit, Retry to debug, Ignore to continue". But when deciding to ignore, I get a Windows error indicating that GNU Emacs encountered a problem and ought to stop (approximately translated from the French error message).

The error signature given is :
AppName: emacs.exe
ModName: msvcrt.dll
ModVer: 7.0.2600.2180
Offset: 000360cb

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).

Apart from the opening curly brace which is on the + but not on the - in the changelog, I guess it would be ok for emacs and thus prevent the error from Windows.


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 via email to

[Prev in Thread] Current Thread [Next in Thread]