]> code.delx.au - gnu-emacs/blobdiff - src/callproc.c
Update copyright year to 2015
[gnu-emacs] / src / callproc.c
index e3dcc7bbccac254476230f9473091f2ad1797bf5..0fdf278073d32070ba09a2925b4e0e0305d0b784 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
@@ -127,6 +127,14 @@ encode_current_directory (void)
 
   dir = expand_and_dir_to_file (dir, Qnil);
 
+  if (NILP (Ffile_accessible_directory_p (dir)))
+    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);
+
   if (STRING_MULTIBYTE (dir))
     dir = ENCODE_FILE (dir);
   if (! file_accessible_directory_p (dir))
@@ -844,7 +852,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
                                 (process_coding.dst_pos_byte
                                  + process_coding.produced),
                                 0);
-                 display_on_the_fly = 0;
+                 display_on_the_fly = false;
                  process_coding = saved_coding;
                  carryover = nread;
                  /* Make the above condition always fail in the future.  */
@@ -876,9 +884,9 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
              /* This variable might have been set to 0 for code
                 detection.  In that case, set it back to 1 because
                 we should have already detected a coding system.  */
-             display_on_the_fly = 1;
+             display_on_the_fly = true;
            }
-         immediate_quit = 1;
+         immediate_quit = true;
          QUIT;
        }
     give_up: ;
@@ -1307,13 +1315,10 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
 
     if (STRINGP (display))
       {
-       char *vdata;
-
        if (MAX_ALLOCA - sizeof "DISPLAY=" < SBYTES (display))
          exec_failed (new_argv[0], ENOMEM);
-       vdata = alloca (sizeof "DISPLAY=" + SBYTES (display));
-       strcpy (vdata, "DISPLAY=");
-       strcat (vdata, SSDATA (display));
+       char *vdata = alloca (sizeof "DISPLAY=" + SBYTES (display));
+       lispstpcpy (stpcpy (vdata, "DISPLAY="), display);
        new_env = add_env (env, new_env, vdata);
       }