diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2015-01-14 10:08:44 +0300 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2015-01-14 10:08:44 +0300 |
commit | d7e26b44109f4068d41a075fa89d11c1a8156f66 (patch) | |
tree | 141efe83d87a6bfceeadb4e04e38979e5df3c8c1 /src/process.h | |
parent | 01ebf7a3655541ef09cee068bddffbc1b38c69c8 (diff) | |
download | emacs-d7e26b44109f4068d41a075fa89d11c1a8156f66.tar.gz |
Consolidate common path transformation code.
* process.h (remove_slash_colon): New function.
* callproc.c (encode_current_directory, call_process):
* process.c (Fstart_process): Use it.
Diffstat (limited to 'src/process.h')
-rw-r--r-- | src/process.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/process.h b/src/process.h index 7803672d61a..58b1daecfe6 100644 --- a/src/process.h +++ b/src/process.h @@ -237,4 +237,17 @@ extern Lisp_Object network_interface_list (void); extern Lisp_Object network_interface_info (Lisp_Object); #endif +/* If program file NAME starts with /: for quoting a magic + name, remove that, preserving the multibyteness of NAME. */ + +INLINE Lisp_Object +remove_slash_colon (Lisp_Object name) +{ + return + ((SBYTES (name) > 2 && SREF (name, 0) == '/' && SREF (name, 1) == ':') + ? make_specified_string (SSDATA (name) + 2, SCHARS (name) - 2, + SBYTES (name) - 2, STRING_MULTIBYTE (name)) + : name); +} + INLINE_HEADER_END |