diff --git a/src/editfns.c b/src/editfns.c index efdf7f74e8dd5d2e846893ee1c5bc155825863a1..368727619c0de2ef06bbca769a9ce345a5b394fb 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -19,7 +19,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" + +#ifdef VMS +#include "pwd.h" +#else #include +#endif + #include "lisp.h" #include "buffer.h" #include "window.h" diff --git a/src/emacs.c b/src/emacs.c index 3757d5ae6b2ae6bba9e21ca2786d8c22abeaa650..cbdc2a2f7480c2a86e36d22b6aa605a394607158 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -379,8 +379,10 @@ main (argc, argv, envp) signal (22, fatal_error_signal); signal (23, fatal_error_signal); signal (24, fatal_error_signal); +#ifdef SIGIO signal (SIGAIO, fatal_error_signal); signal (SIGPTY, fatal_error_signal); +#endif signal (SIGIOINT, fatal_error_signal); signal (SIGGRANT, fatal_error_signal); signal (SIGRETRACT, fatal_error_signal); diff --git a/src/fileio.c b/src/fileio.c index b6035656d09dc64ca4cc0c8431b9c7702fb64f62..a99b77b0687355743d3681d411c9664fd6bda933 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -20,12 +20,27 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include + +#ifdef VMS +#include "pwd.h" +#else #include +#endif + #include + +#ifdef VMS +#include "dir.h" +#include +#include +#include +#else #include +#endif + #include -#ifndef VMS +#ifndef vax11c extern int errno; extern char *sys_errlist[]; extern int sys_nerr; @@ -46,7 +61,6 @@ extern int sys_nerr; #include "window.h" #ifdef VMS -#include #include #include #include @@ -217,7 +231,8 @@ file_name_as_directory (out, in) brack = ']'; strcpy (out, "[."); } - if (dot = index (p, '.')) + dot = index (p, '.'); + if (dot) { /* blindly remove any extension */ size = strlen (out) + (dot - p); @@ -348,7 +363,8 @@ directory_file_name (src, dst) /* If bracket is ']' or '>', bracket - 2 is the corresponding opening bracket. */ - if (!(ptr = index (src, bracket - 2))) + ptr = index (src, bracket - 2); + if (ptr == 0) { /* no opening bracket */ strcpy (dst, src); return 0; @@ -648,9 +664,24 @@ See also the function `substitute-in-file-name'.") newdir = XSTRING (defalt)->data; } - /* Now concatenate the directory and name to new space in the stack frame */ + if (newdir != 0) + { + /* Get rid of any slash at the end of newdir. */ + int length = strlen (newdir); + if (newdir[length - 1] == '/') + { + unsigned char *temp = (unsigned char *) alloca (length); + bcopy (newdir, temp, length - 1); + temp[length - 1] = 0; + newdir = temp; + } + tlen = length + 1; + } + else + tlen = 0; - tlen = (newdir ? strlen (newdir) + 1 : 0) + strlen (nm) + 1; + /* Now concatenate the directory and name to new space in the stack frame */ + tlen += strlen (nm) + 1; target = (unsigned char *) alloca (tlen); *target = 0; diff --git a/src/filelock.c b/src/filelock.c index 81e72432c069ca9b0db6ea6017d93e87a8b8a0b5..df1794cf6bc72bdb7c1e71d9ed8f3363cee26c7e 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -20,7 +20,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include "config.h" + +#ifdef VMS +#include "pwd.h" +#else #include +#endif + #include #include #ifdef USG