diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2015-01-14 09:50:39 +0300 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2015-01-14 09:50:39 +0300 |
commit | 01ebf7a3655541ef09cee068bddffbc1b38c69c8 (patch) | |
tree | 41300cd8f3167f16aebc536d8322dbc757eb4f5a /src/callproc.c | |
parent | 3ef29501b029567156440d257c758b99099213fe (diff) | |
download | emacs-01ebf7a3655541ef09cee068bddffbc1b38c69c8.tar.gz |
Avoid extra multibyteness check in ENCODE_FILE users.
* callproc.c (encode_current_directory, Fcall_process, call_process):
* dired.c (directory_files_internal, file_name_completion):
Do not check for STRING_MULTIBYTE because encode_file_name
is a no-op for unibyte strings.
Diffstat (limited to 'src/callproc.c')
-rw-r--r-- | src/callproc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/callproc.c b/src/callproc.c index 0fdf278073d..970a2017b38 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -135,8 +135,7 @@ encode_current_directory (void) if (! NILP (Fstring_match (build_string ("^/:"), dir, Qnil))) dir = Fsubstring (dir, make_number (2), Qnil); - if (STRING_MULTIBYTE (dir)) - dir = ENCODE_FILE (dir); + dir = ENCODE_FILE (dir); if (! file_accessible_directory_p (dir)) report_file_error ("Setting current directory", BVAR (current_buffer, directory)); @@ -267,7 +266,7 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS) * 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) @@ -439,9 +438,9 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, 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; } @@ -498,8 +497,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, } else new_argv[1] = 0; - if (STRING_MULTIBYTE (path)) - path = ENCODE_FILE (path); + path = ENCODE_FILE (path); new_argv[0] = SSDATA (path); UNGCPRO; } |