diff options
| author | Kenichi Handa | 2012-08-16 21:25:17 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-08-16 21:25:17 +0900 |
| commit | d75ffb4ed0b2e72a9361a07d16a5c884a9459728 (patch) | |
| tree | 8ac5a6a8ae033fef7fbc7fb7b09a703ef4b0ed5b /src/callproc.c | |
| parent | 69c41c4070c86baac11a627e9c3d366420aeb7cc (diff) | |
| parent | 250c8ab9b8f6322959fa3122db83944c30c3894b (diff) | |
| download | emacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.tar.gz emacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.zip | |
merge trunk
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/src/callproc.c b/src/callproc.c index facca887772..10a80168fb2 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -427,8 +427,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 427 | && SREF (path, 1) == ':') | 427 | && SREF (path, 1) == ':') |
| 428 | path = Fsubstring (path, make_number (2), Qnil); | 428 | path = Fsubstring (path, make_number (2), Qnil); |
| 429 | 429 | ||
| 430 | SAFE_ALLOCA (new_argv, const unsigned char **, | 430 | new_argv = SAFE_ALLOCA ((nargs > 4 ? nargs - 2 : 2) * sizeof *new_argv); |
| 431 | (nargs > 4 ? nargs - 2 : 2) * sizeof *new_argv); | ||
| 432 | if (nargs > 4) | 431 | if (nargs > 4) |
| 433 | { | 432 | { |
| 434 | ptrdiff_t i; | 433 | ptrdiff_t i; |
| @@ -978,8 +977,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r | |||
| 978 | Lisp_Object coding_systems; | 977 | Lisp_Object coding_systems; |
| 979 | Lisp_Object val, *args2; | 978 | Lisp_Object val, *args2; |
| 980 | ptrdiff_t i; | 979 | ptrdiff_t i; |
| 981 | char *tempfile; | 980 | Lisp_Object tmpdir; |
| 982 | Lisp_Object tmpdir, pattern; | ||
| 983 | 981 | ||
| 984 | if (STRINGP (Vtemporary_file_directory)) | 982 | if (STRINGP (Vtemporary_file_directory)) |
| 985 | tmpdir = Vtemporary_file_directory; | 983 | tmpdir = Vtemporary_file_directory; |
| @@ -1003,8 +1001,8 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r | |||
| 1003 | 1001 | ||
| 1004 | { | 1002 | { |
| 1005 | USE_SAFE_ALLOCA; | 1003 | USE_SAFE_ALLOCA; |
| 1006 | pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); | 1004 | Lisp_Object pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); |
| 1007 | SAFE_ALLOCA (tempfile, char *, SBYTES (pattern) + 1); | 1005 | char *tempfile = SAFE_ALLOCA (SBYTES (pattern) + 1); |
| 1008 | memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1); | 1006 | memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1); |
| 1009 | coding_systems = Qt; | 1007 | coding_systems = Qt; |
| 1010 | 1008 | ||
| @@ -1515,29 +1513,24 @@ egetenv (const char *var) | |||
| 1515 | void | 1513 | void |
| 1516 | init_callproc_1 (void) | 1514 | init_callproc_1 (void) |
| 1517 | { | 1515 | { |
| 1518 | char *data_dir = egetenv ("EMACSDATA"); | ||
| 1519 | char *doc_dir = egetenv ("EMACSDOC"); | ||
| 1520 | #ifdef HAVE_NS | 1516 | #ifdef HAVE_NS |
| 1521 | const char *etc_dir = ns_etc_directory (); | 1517 | const char *etc_dir = ns_etc_directory (); |
| 1522 | const char *path_exec = ns_exec_path (); | 1518 | const char *path_exec = ns_exec_path (); |
| 1523 | #endif | 1519 | #endif |
| 1524 | 1520 | ||
| 1525 | Vdata_directory | 1521 | Vdata_directory = decode_env_path ("EMACSDATA", |
| 1526 | = Ffile_name_as_directory (build_string (data_dir ? data_dir | ||
| 1527 | #ifdef HAVE_NS | 1522 | #ifdef HAVE_NS |
| 1528 | : (etc_dir ? etc_dir : PATH_DATA) | 1523 | etc_dir ? etc_dir : |
| 1529 | #else | ||
| 1530 | : PATH_DATA | ||
| 1531 | #endif | 1524 | #endif |
| 1532 | )); | 1525 | PATH_DATA); |
| 1533 | Vdoc_directory | 1526 | Vdata_directory = Ffile_name_as_directory (Fcar (Vdata_directory)); |
| 1534 | = Ffile_name_as_directory (build_string (doc_dir ? doc_dir | 1527 | |
| 1528 | Vdoc_directory = decode_env_path ("EMACSDOC", | ||
| 1535 | #ifdef HAVE_NS | 1529 | #ifdef HAVE_NS |
| 1536 | : (etc_dir ? etc_dir : PATH_DOC) | 1530 | etc_dir ? etc_dir : |
| 1537 | #else | ||
| 1538 | : PATH_DOC | ||
| 1539 | #endif | 1531 | #endif |
| 1540 | )); | 1532 | PATH_DOC); |
| 1533 | Vdoc_directory = Ffile_name_as_directory (Fcar (Vdoc_directory)); | ||
| 1541 | 1534 | ||
| 1542 | /* Check the EMACSPATH environment variable, defaulting to the | 1535 | /* Check the EMACSPATH environment variable, defaulting to the |
| 1543 | PATH_EXEC path from epaths.h. */ | 1536 | PATH_EXEC path from epaths.h. */ |
| @@ -1578,7 +1571,7 @@ init_callproc (void) | |||
| 1578 | Lisp_Object tem; | 1571 | Lisp_Object tem; |
| 1579 | tem = Fexpand_file_name (build_string ("lib-src"), | 1572 | tem = Fexpand_file_name (build_string ("lib-src"), |
| 1580 | Vinstallation_directory); | 1573 | Vinstallation_directory); |
| 1581 | #ifndef DOS_NT | 1574 | #ifndef MSDOS |
| 1582 | /* MSDOS uses wrapped binaries, so don't do this. */ | 1575 | /* MSDOS uses wrapped binaries, so don't do this. */ |
| 1583 | if (NILP (Fmember (tem, Vexec_path))) | 1576 | if (NILP (Fmember (tem, Vexec_path))) |
| 1584 | { | 1577 | { |
| @@ -1595,7 +1588,7 @@ init_callproc (void) | |||
| 1595 | } | 1588 | } |
| 1596 | 1589 | ||
| 1597 | Vexec_directory = Ffile_name_as_directory (tem); | 1590 | Vexec_directory = Ffile_name_as_directory (tem); |
| 1598 | #endif /* not DOS_NT */ | 1591 | #endif /* not MSDOS */ |
| 1599 | 1592 | ||
| 1600 | /* Maybe use ../etc as well as ../lib-src. */ | 1593 | /* Maybe use ../etc as well as ../lib-src. */ |
| 1601 | if (data_dir == 0) | 1594 | if (data_dir == 0) |