void (*call_command_hook) PARAMS ((struct cmd_list_element *c, char *cmd,
int from_tty));
+
+
+/* Takes control from error (). Typically used to prevent longjmps out of the
+ middle of the GUI. Usually used in conjunction with a catch routine. */
+
+NORETURN void (*error_hook) PARAMS (());
+
\f
/* Where to go for return_to_top_level (RETURN_ERROR). */
jmp_buf error_return;
{
warning ("Your new `%s' command does not hook any existing command.",
comname);
- if (!query ("Proceed? ", (char *)0))
+ if (!query ("Proceed? "))
error ("Not confirmed.");
}
}
perror_with_name (dir);
len = strlen (dir);
- dir = savestring (dir, len - (len > 1 && dir[len-1] == '/'));
- if (dir[0] == '/')
+ dir = savestring (dir, len - (len > 1 && SLASH_P(dir[len-1])));
+ if (ROOTED_P(dir))
current_directory = dir;
else
{
- if (current_directory[0] == '/' && current_directory[1] == '\0')
+ if (SLASH_P (current_directory[0]) && current_directory[1] == '\0')
current_directory = concat (current_directory, dir, NULL);
else
- current_directory = concat (current_directory, "/", dir, NULL);
+ current_directory = concat (current_directory, SLASH_STRING, dir, NULL);
free (dir);
}
found_real_path = 0;
for (p = current_directory; *p;)
{
- if (p[0] == '/' && p[1] == '.' && (p[2] == 0 || p[2] == '/'))
+ if (SLASH_P (p[0]) && p[1] == '.' && (p[2] == 0 || SLASH_P (p[2])))
strcpy (p, p + 2);
- else if (p[0] == '/' && p[1] == '.' && p[2] == '.'
- && (p[3] == 0 || p[3] == '/'))
+ else if (SLASH_P (p[0]) && p[1] == '.' && p[2] == '.'
+ && (p[3] == 0 || SLASH_P (p[3])))
{
if (found_real_path)
{
/* Search backwards for the directory just before the "/.."
and obliterate it and the "/..". */
char *q = p;
- while (q != current_directory && q[-1] != '/')
+ while (q != current_directory && ! SLASH_P (q[-1]))
--q;
if (q == current_directory)