/* Synchronous subprocess invocation for GNU Emacs.
-Copyright (C) 1985-1988, 1993-1995, 1999-2014 Free Software Foundation,
+Copyright (C) 1985-1988, 1993-1995, 1999-2015 Free Software Foundation,
Inc.
This file is part of GNU Emacs.
report_file_error ("Setting current directory",
BVAR (current_buffer, directory));
- /* Remove "/:" from dir. */
- if (! NILP (Fstring_match (build_string ("^/:"), dir, Qnil)))
- dir = Fsubstring (dir, make_number (2), Qnil);
+ /* Remove "/:" from DIR and encode it. */
+ dir = ENCODE_FILE (remove_slash_colon (dir));
- if (STRING_MULTIBYTE (dir))
- dir = ENCODE_FILE (dir);
if (! file_accessible_directory_p (dir))
report_file_error ("Setting current directory",
BVAR (current_buffer, directory));
infile = build_string (NULL_DEVICE);
GCPRO1 (infile);
- encoded_infile = STRING_MULTIBYTE (infile) ? ENCODE_FILE (infile) : infile;
+ encoded_infile = ENCODE_FILE (infile);
filefd = emacs_open (SSDATA (encoded_infile), O_RDONLY, 0);
if (filefd < 0)
GCPRO4 (buffer, current_dir, error_file, output_file);
- if (STRINGP (error_file) && STRING_MULTIBYTE (error_file))
+ if (STRINGP (error_file))
error_file = ENCODE_FILE (error_file);
- if (STRINGP (output_file) && STRING_MULTIBYTE (output_file))
+ if (STRINGP (output_file))
output_file = ENCODE_FILE (output_file);
UNGCPRO;
}
report_file_error ("Searching for program", args[0]);
}
- /* If program file name starts with /: for quoting a magic name,
- discard that. */
- if (SBYTES (path) > 2 && SREF (path, 0) == '/'
- && SREF (path, 1) == ':')
- path = Fsubstring (path, make_number (2), Qnil);
+ /* Remove "/:" from PATH. */
+ path = remove_slash_colon (path);
SAFE_NALLOCA (new_argv, 1, nargs < 4 ? 2 : nargs - 2);
}
else
new_argv[1] = 0;
- if (STRING_MULTIBYTE (path))
- path = ENCODE_FILE (path);
+ path = ENCODE_FILE (path);
new_argv[0] = SSDATA (path);
UNGCPRO;
}
specbind (intern ("coding-system-for-write"), val);
/* POSIX lets mk[s]temp use "."; don't invoke jka-compr if we
happen to get a ".Z" suffix. */
- specbind (intern ("file-name-handler-alist"), Qnil);
+ specbind (Qfile_name_handler_alist, Qnil);
write_region (start, end, filename_string, Qnil, Qlambda, Qnil, Qnil, fd);
unbind_to (count1, Qnil);