To: vim-dev@vim.org Subject: patch 5.5.046 (extra) Fcc: outbox From: Bram Moolenaar ------------ Patch 5.5.046 (extra) Problem: VMS: problems with path and filename. Solution: Truncate file name at last ';', etc. (Zoltan Arpadffy) Files: src/buffer.c, src/fileio.c, src/gui_motif.c, src/os_vms.c, src/proto/os_vms.pro *** ../vim-5.5.45/src/buffer.c Wed Dec 1 20:19:06 1999 --- src/buffer.c Wed Dec 1 19:50:27 1999 *************** *** 66,71 **** --- 66,82 ---- && (curbuf->b_flags & BF_NEVERLOADED)) curbuf->b_p_ro = TRUE; + #ifdef VMS + if (curbuf->b_ffname != NULL) + { + char *ptr; + + ptr = strrchr((char *)curbuf->b_ffname, ';'); + if (ptr != NULL) + *ptr = '\0'; + } + #endif + if (ml_open() == FAIL) { /* *** ../vim-5.5.45/src/fileio.c Sun Oct 31 14:29:00 1999 --- src/fileio.c Mon Nov 29 20:01:45 1999 *************** *** 2523,2528 **** --- 2523,2533 ---- if (retval == NULL) return NULL; STRCPY(retval, fname); + #ifdef VMS + ptr = (char_u *)strrchr((char *)retval, ';'); + if (ptr != NULL) + *ptr = '\0'; + #endif } /* *** ../vim-5.5.45/src/gui_motif.c Wed Sep 22 10:06:24 1999 --- src/gui_motif.c Mon Nov 29 20:06:45 1999 *************** *** 861,867 **** --- 861,871 ---- dflt = (char_u *)""; if (initdir == NULL || *initdir == NUL) { + #ifdef VMS + mch_dirname_vms(dirbuf, MAXPATHL); + #else mch_dirname(dirbuf, MAXPATHL); + #endif initdir = dirbuf; } *** ../vim-5.5.45/src/os_vms.c Wed Sep 22 10:06:27 1999 --- src/os_vms.c Mon Nov 29 20:10:40 1999 *************** *** 976,1001 **** #endif /* ! * mch_dirname Get name of current directory into buffer 'buf' ! * of length 'len' bytes. Return OK for success, ! * FAIL for failure. */ - int mch_dirname(char_u *buf, int len) { if (!getcwd((char *)buf, len)) { STRCPY(buf, strerror(errno)); ! return(FAIL); } /* tranlate from VMS to UNIX format */ ! STRNCPY(buf,decc$translate_vms((char *)buf),len); ! STRCAT(buf,"/"); ! return(OK); } /* * mch_FullName get absolute filename into buffer 'buf' of * length 'len' bytes, return FAIL for failure, * OK for success --- 976,1016 ---- #endif /* ! * Get name of current directory into buffer 'buf' of length 'len' bytes. ! * Return OK for success, FAIL for failure. */ int mch_dirname(char_u *buf, int len) { if (!getcwd((char *)buf, len)) { STRCPY(buf, strerror(errno)); ! return FAIL; } /* tranlate from VMS to UNIX format */ ! STRNCPY(buf, decc$translate_vms((char *)buf), len); ! STRCAT(buf, "/"); ! return OK; } /* + * Get name of current directory into buffer 'buf' of length 'len' bytes. + * In VMS format + * Return OK for success, FAIL for failure. + */ + int + mch_dirname_vms(char_u *buf, int len) + { + if (!getcwd((char *)buf, len)) + { + STRCPY(buf, strerror(errno)); + return FAIL; + } + return OK; + } + + + /* * mch_FullName get absolute filename into buffer 'buf' of * length 'len' bytes, return FAIL for failure, * OK for success *** ../vim-5.5.45/src/proto/os_vms.pro Wed Sep 22 10:06:15 1999 --- src/proto/os_vms.pro Mon Nov 29 20:12:16 1999 *************** *** 20,25 **** --- 20,26 ---- void mch_get_host_name __ARGS((char_u *s, int len)); long mch_get_pid __ARGS((void)); int mch_dirname __ARGS((char_u *buf, int len)); + int mch_dirname_vms __ARGS((char_u *buf, int len)); int mch_FullName __ARGS((char_u *fname, char_u *buf, int len, int force)); int mch_isFullName __ARGS((char_u *fname)); long getperm __ARGS((char_u *name)); *** ../vim-5.5.45/src/version.c Sat Dec 4 13:46:31 1999 --- src/version.c Sat Dec 4 13:49:23 1999 *************** *** 420,420 **** --- 420,421 ---- { /* Add new patch number below this line */ + 46, -- hundred-and-one symptoms of being an internet addict: 231. You sprinkle Carpet Fresh on the rugs and put your vacuum cleaner in the front doorway permanently so it always looks like you are actually attempting to do something about that mess that has amassed since you discovered the Internet. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /