const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
const char emacs_version[] = "24.0.50";
-extern void malloc_warning (char *);
-extern void set_time_zone_rule (char *);
#ifdef HAVE_INDEX
extern char *index (const char *, int);
#endif
#endif
Lisp_Object
-decode_env_path (evarname, defalt)
- char *evarname, *defalt;
+decode_env_path (const char *evarname, const char *defalt)
{
- register char *path, *p;
+ const char *path, *p;
Lisp_Object lpath, element, tem;
/* It's okay to use getenv here, because this function is only used
to initialize variables when Emacs starts up, and isn't called
after that. */
if (evarname != 0)
- path = (char *) getenv (evarname);
+ path = getenv (evarname);
else
path = 0;
if (!path)
/* Ensure values from the environment use the proper directory separator. */
if (path)
{
- p = alloca (strlen (path) + 1);
- strcpy (p, path);
- path = p;
-
- dostounix_filename (path);
+ char *path_copy = alloca (strlen (path) + 1);
+ strcpy (path_copy, path);
+ dostounix_filename (path_copy);
+ path = path_copy;
}
#endif
lpath = Qnil;
while (1)
{
p = index (path, SEPCHAR);
- if (!p) p = path + strlen (path);
+ if (!p)
+ p = path + strlen (path);
element = (p - path ? make_string (path, p - path)
: build_string ("."));