Skip to content
Snippets Groups Projects
Commit 4fc3da3a authored by slevy's avatar slevy
Browse files

Use winjunk.h's access() defs.

Accept ~/file and ./file without path searching.
parent 116e7425
No related branches found
No related tags found
No related merge requests found
......@@ -24,10 +24,9 @@ static char *copyright = "Copyright (C) 1992 The Geometry Center";
#include "shmem.h"
#if defined(unix) || defined(__unix)
#include <unistd.h> /* needed for access() */
# include <unistd.h> /* needed for access() */
#else /* Win32 */
# include <io.h>
# define R_OK 4 /* No Windows include file defines this?! */
# include "winjunk.h"
#endif
#include <stdlib.h>
......@@ -134,7 +133,8 @@ findfile(char *superfile, char *file)
path = NULL;
}
if (file == NULL) return NULL;
if (file[0] == '/' || file[0] == '$') {
if (file[0] == '/' || file[0] == '$' || file[0] == '~'
|| (file[0] == '.' && file[1] == '/') ) {
strcpy(pbuf, file);
envexpand(pbuf);
if (access(pbuf,R_OK)==0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment