home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
rcs567s.zip
/
rcsfront
/
patches.os2
< prev
next >
Wrap
Text File
|
1994-07-04
|
24KB
|
862 lines
*** cio.c.orig Wed Mar 23 15:33:46 1994
--- cio.c Wed Mar 23 15:28:06 1994
***************
*** 63,72 ****
#include <sys/stat.h>
#include <errno.h>
#include <signal.h>
! /*--------------------------------------------------- externals ------------*/
! extern int errno; /* error code set by system library routines */
extern FILE *fopen(); /* open a stream (should be in stdio.h) */
extern FILE *popen(); /* open a pipe (should be in stdio.h) */
extern char *getenv(); /* read an environment variable */
--- 63,80 ----
#include <sys/stat.h>
#include <errno.h>
#include <signal.h>
+ #include <fcntl.h>
! #ifdef __EMX__
! #define getcwd _getcwd2
! #endif
+ #ifndef OS2
+ #define stricmp strcmp
+ #define strnicmp strncmp
+ #endif
+
+ /*--------------------------------------------------- externals ------------*/
extern FILE *fopen(); /* open a stream (should be in stdio.h) */
extern FILE *popen(); /* open a pipe (should be in stdio.h) */
extern char *getenv(); /* read an environment variable */
***************
*** 187,199 ****
register int in;
register char *cp; /* used in string updates. */
prognam = justname(argv[0]); /* program name */
getdir(); /* go get the enviroment pointers. */
/*
* figure what the user wants us to be by reading program name
*/
! if (!strcmp("ciitest", prognam) || !strcmp("cootest", prognam))
{
getrcsdir(final, currentdir); /* setup variables. */
/*
--- 195,217 ----
register int in;
register char *cp; /* used in string updates. */
+ #ifdef __EMX__
+ _response(&argc, &argv);
+ _wildcard(&argc, &argv);
+ _emxload_env("RCSLOAD");
+ #endif
+
prognam = justname(argv[0]); /* program name */
+ #ifdef OS2
+ if ( stricmp(prognam + 3, ".exe") == 0 )
+ prognam[3] = 0;
+ #endif
getdir(); /* go get the enviroment pointers. */
/*
* figure what the user wants us to be by reading program name
*/
! if (!stricmp("ciitest", prognam) || !stricmp("cootest", prognam))
{
getrcsdir(final, currentdir); /* setup variables. */
/*
***************
*** 211,224 ****
(void) printf("Final dir:%s:\n", final);
return(0);
}
! if (!strcmp("cii", prognam)) /* this is input.. */
cii = TRUE; /* show we are inputs. */
! else if (strcmp("coo", prognam))/* it's not this either.. */
{
(void) printf("Just what did you think this program was, anyway??\n");
return(-1);
}
if (!(user_id = geteuid())) /* we are a root process.. */
{
(void) umask(027); /* set general mask to private modes. */
--- 228,242 ----
(void) printf("Final dir:%s:\n", final);
return(0);
}
! if (!stricmp("cii", prognam)) /* this is input.. */
cii = TRUE; /* show we are inputs. */
! else if (stricmp("coo", prognam))/* it's not this either.. */
{
(void) printf("Just what did you think this program was, anyway??\n");
return(-1);
}
+ #ifndef OS2
if (!(user_id = geteuid())) /* we are a root process.. */
{
(void) umask(027); /* set general mask to private modes. */
***************
*** 234,243 ****
}
else
real_user_id = user_id; /* else they should match. */
/* prepare for disasters */
! (void) signal(SIGINT, (int (*)()) sigcleanup);
! (void) signal(SIGQUIT, (int (*)()) sigcleanup);
cp = cioopt;
title[0] = '\0'; /* make sure no titles are required. */
--- 252,275 ----
}
else
real_user_id = user_id; /* else they should match. */
+ #else
+ real_user_id = 1; /* else they should match. */
+ #endif
/* prepare for disasters */
! (void) signal(SIGINT, sigcleanup);
! #ifndef OS2
! (void) signal(SIGQUIT, sigcleanup);
! #else
! (void) signal(SIGBREAK, sigcleanup); /* OS/2 */
! (void) signal(SIGTERM, sigcleanup); /* signals */
! #endif
!
! if ( argc <= 1 )
! {
! usage();
! return(0);
! }
cp = cioopt;
title[0] = '\0'; /* make sure no titles are required. */
***************
*** 281,287 ****
#else
case 'y': /* they gave us one */
#endif
! (void) strcpy(logstr, &argv[in][1]); /* copy across. */
break;
case 't': /* user gave us one */
(void) strcpy(title, &argv[in][1]);
--- 313,320 ----
#else
case 'y': /* they gave us one */
#endif
! (void) strcpy(logstr, " -");
! (void) strcat(logstr, &argv[in][1]); /* copy across. */
break;
case 't': /* user gave us one */
(void) strcpy(title, &argv[in][1]);
***************
*** 374,380 ****
}
for ( ; in < argc; in++)
{
! (void) sprintf(entry, "%s/%s", currentdir, argv[in]);
#ifdef DEBUG
(void) printf("Processing %s\n", entry);
#endif
--- 407,416 ----
}
for ( ; in < argc; in++)
{
! #ifdef OS2
! UnixFileName(argv[in]);
! #endif
! (void) sprintf(entry, "%s%s", currentdir, argv[in]);
#ifdef DEBUG
(void) printf("Processing %s\n", entry);
#endif
***************
*** 406,412 ****
;
for ( ; in < argc; in++)
{
! (void) sprintf(ep, "/%s", argv[in]);
#ifdef DEBUG
(void) printf("Processing %s\n", entry);
#endif
--- 442,451 ----
;
for ( ; in < argc; in++)
{
! #ifdef OS2
! UnixFileName(argv[in]);
! #endif
! (void) sprintf(ep, "%s", argv[in]);
#ifdef DEBUG
(void) printf("Processing %s\n", entry);
#endif
***************
*** 438,444 ****
--- 477,489 ----
FILE *pp;
char *cmd, *entry;
+ if ( dir[strlen(dir) - 1] == '/' )
+ dir[strlen(dir) - 1] = 0;
+ #ifdef OS2
+ (void) sprintf(cmd = memalloc(strlen(dir) + 10), "dir /b \"%s\"", dir);
+ #else
(void) sprintf(cmd = memalloc(strlen(dir) + 4), "ls %s", dir);
+ #endif
pp = popen(cmd, "r");
free(cmd);
if (!pp)
***************
*** 506,512 ****
if (noexec)
{
(void) printf("Logfile entry bypassed.\n");
! (void) strcpy(logstr, " "); /* fake it */
}
else if (!getfinput(titlest, TYPE_LOG)) /* if we entered anything */
{
--- 551,557 ----
if (noexec)
{
(void) printf("Logfile entry bypassed.\n");
! (void) strcpy(logstr, ""); /* fake it */
}
else if (!getfinput(titlest, TYPE_LOG)) /* if we entered anything */
{
***************
*** 570,576 ****
if (access(final, 0)) /* it's not here... */
if (!makedir(final)) /* so try and make it. */
{
! (void) printf("Could not create directory :%s:\n", final);
return(FALSE);
}
*st = '/'; /* restore the rest of the file name. */
--- 615,621 ----
if (access(final, 0)) /* it's not here... */
if (!makedir(final)) /* so try and make it. */
{
! (void) printf("Could not create directory: %s:\n", final);
return(FALSE);
}
*st = '/'; /* restore the rest of the file name. */
***************
*** 625,634 ****
(void) printf("%s already exists. Overwrite? (yes) ", final);
(void) strrd(cmdbuf, 20, stdin);
(void) strlwr(cmdbuf);
! if (strncmp(cmdbuf, "yes", strlen(cmdbuf)))
return(TRUE);
}
! (void) sprintf(cmdbuf, "cp %s %s", filename, final); /* copy command */
}
else if (cii)
{
--- 670,679 ----
(void) printf("%s already exists. Overwrite? (yes) ", final);
(void) strrd(cmdbuf, 20, stdin);
(void) strlwr(cmdbuf);
! if (strnicmp(cmdbuf, "yes", strlen(cmdbuf)))
return(TRUE);
}
! (void) sprintf(cmdbuf, "cp -p %s %s", filename, final); /* copy command */
}
else if (cii)
{
***************
*** 712,718 ****
if (!*st)
(void) strcpy(st, "yes");
(void) strlwr(st);
! if (!strncmp(st, "yes", strlen(st))) {
done = TRUE;
(void) system(cmdbuf); /* do it. */
}
--- 757,763 ----
if (!*st)
(void) strcpy(st, "yes");
(void) strlwr(st);
! if (!strnicmp(st, "yes", strlen(st))) {
done = TRUE;
(void) system(cmdbuf); /* do it. */
}
***************
*** 725,731 ****
(void) printf("? Print this message\n");
(void) printf("\n");
}
! else if (!strncmp(st, "view", strlen(st)))
{
(void) printf("Not implemented yet!\n\n");
}
--- 770,776 ----
(void) printf("? Print this message\n");
(void) printf("\n");
}
! else if (!strnicmp(st, "view", strlen(st)))
{
(void) printf("Not implemented yet!\n\n");
}
***************
*** 737,743 ****
{
#endif /* INTERACTIVE */
if (verbose)
! (void) printf("%s command :%s:\n", prognam, cmdbuf);
if (!noexec)
{
if (do_copy && !verbose)
--- 782,788 ----
{
#endif /* INTERACTIVE */
if (verbose)
! (void) printf("%s command: %s:\n", prognam, cmdbuf);
if (!noexec)
{
if (do_copy && !verbose)
***************
*** 749,765 ****
#ifdef INTERACTIVE
}
#endif /* INTERACTIVE */
if (updsrcdir) /* update source directory */
{
getsrcdir(final, filename);
! (void) sprintf(cmdbuf, "cp %s %s", filename, final);
if (noexec) /* don't actual do it */
(void) printf("%s\n", cmdbuf);
else
{
if (verbose) /* speak, yo wise one! */
! (void) printf("%s command :%s:\n", prognam, cmdbuf);
! if (!strcmp(filename, final))
(void) printf("Source and destination identical. Not updated.\n");
else
{
--- 794,824 ----
#ifdef INTERACTIVE
}
#endif /* INTERACTIVE */
+
if (updsrcdir) /* update source directory */
{
getsrcdir(final, filename);
!
! if (st = strrchr(final, '/')) /* if this has a sub dir. */
! {
! *st = '\0'; /* terminate it at the directoy level. */
! if (access(final, 0)) /* it's not here... */
! if (!makedir(final)) /* so try and make it. */
! {
! (void) printf("Could not create directory: %s:\n", final);
! return(FALSE);
! }
! *st = '/'; /* restore the rest of the file name. */
! }
!
! (void) sprintf(cmdbuf, "cp -p %s %s", filename, final);
if (noexec) /* don't actual do it */
(void) printf("%s\n", cmdbuf);
else
{
if (verbose) /* speak, yo wise one! */
! (void) printf("%s command: %s:\n", prognam, cmdbuf);
! if (!stricmp(filename, final))
(void) printf("Source and destination identical. Not updated.\n");
else
{
***************
*** 852,874 ****
char *header; /* header template file name. */
} ftype[] = {
#ifdef V_RCS
! { "c program", ".rcshead.c" }, /* FTYPE_C */
! { "assembler", ".rcshead.s" }, /* FTYPE_S */
! { "command", ".rcshead.sh" }, /* FTYPE_SH */
! { "roff, tbl", ".rcshead.roff" }, /* FTYPE_ROFF */
! { "fortran", ".rcshead.f" }, /* FTYPE_F */
! { 0, ".rcshead" }, /* FTYPE_DEFAULT */
! { 0, ".rcshead.mk" }, /* FTYPE_MK */
! { 0, ".rcshead.h" } }; /* FTYPE_H */
! #else
! { "c program", ".sccshead.c" }, /* FTYPE_C */
! { "assembler", ".sccshead.s" }, /* FTYPE_S */
! { "command", ".sccshead.sh" }, /* FTYPE_SH */
! { "roff, tbl", ".sccshead.roff"}, /* FTYPE_ROFF */
! { "fortran", ".sccshead.f" }, /* FTYPE_F */
! { 0, ".sccshead" }, /* FTYPE_DEFAULT */
! { 0, ".sccshead.mk" }, /* FTYPE_MK */
! { 0, ".sccshead.h" } }; /* FTYPE_H */
#endif /* V_RCS */
static struct _fext {
char *name;
--- 911,933 ----
char *header; /* header template file name. */
} ftype[] = {
#ifdef V_RCS
! { "c program", "rcshead.c" }, /* FTYPE_C */
! { "assembler", "rcshead.s" }, /* FTYPE_S */
! { "command", "rcshead.sh" }, /* FTYPE_SH */
! { "roff, tbl", "rcshead.rof" }, /* FTYPE_ROFF */
! { "fortran", "rcshead.f" }, /* FTYPE_F */
! { 0, "rcshead" }, /* FTYPE_DEFAULT */
! { 0, "rcshead.mk" }, /* FTYPE_MK */
! { 0, "rcshead.h" } }; /* FTYPE_H */
! #else
! { "c program", "sccshead.c" }, /* FTYPE_C */
! { "assembler", "sccshead.s" }, /* FTYPE_S */
! { "command", "sccshead.sh" }, /* FTYPE_SH */
! { "roff, tbl", "sccshead.rof"}, /* FTYPE_ROFF */
! { "fortran", "sccshead.f" }, /* FTYPE_F */
! { 0, "sccshead" }, /* FTYPE_DEFAULT */
! { 0, "sccshead.mk" }, /* FTYPE_MK */
! { 0, "sccshead.h" } }; /* FTYPE_H */
#endif /* V_RCS */
static struct _fext {
char *name;
***************
*** 933,939 ****
if (ext = strrchr(fname, '.'))
{
for (i = 0; fext[i].name; i++)
! if (!strcmp(ext, fext[i].name))
ft = fext[i].type;
}
else
--- 992,998 ----
if (ext = strrchr(fname, '.'))
{
for (i = 0; fext[i].name; i++)
! if (!stricmp(ext, fext[i].name))
ft = fext[i].type;
}
else
***************
*** 946,952 ****
}
else if (ft == FTYPE_C) /* see if source or header */
{
! if ((ext = strrchr(fname, '.')) && !strcmp(ext, ".h"))
ft = FTYPE_H;
}
if (verbose) /* is this necessary */
--- 1005,1011 ----
}
else if (ft == FTYPE_C) /* see if source or header */
{
! if ((ext = strrchr(fname, '.')) && !stricmp(ext, ".h"))
ft = FTYPE_H;
}
if (verbose) /* is this necessary */
***************
*** 965,971 ****
strcpy(tempfile, t_name);
ext = justname(tempfile); /* find end of path. */
*ext = '\0'; /* and terminate path there. */
! (void) strcat(tempfile, "ciotmp._XXXXXX"); /* add tmp name */
(void) mktemp(tempfile); /* generate temp file name */
if (!(ofp = fopen(tempfile, "w"))) /* open temp file */
{
--- 1024,1030 ----
strcpy(tempfile, t_name);
ext = justname(tempfile); /* find end of path. */
*ext = '\0'; /* and terminate path there. */
! (void) strcat(tempfile, "ctXXXXXX"); /* add tmp name */
(void) mktemp(tempfile); /* generate temp file name */
if (!(ofp = fopen(tempfile, "w"))) /* open temp file */
{
***************
*** 997,1007 ****
--- 1056,1072 ----
*/
if(!err && !unlink(t_name)) /* 'mv tempfile fname' */
{
+ #ifndef OS2
if(!link(tempfile, t_name)) /* 'cp tempfile t_name' */
(void) unlink(tempfile); /* 'rm tempfile' */
else
(void) printf("Link of %s and %s failed after removing %s.\n%s not removed.\n",
tempfile, t_name, t_name, tempfile);
+ #else
+ if(!rename(tempfile, t_name)) /* 'cp tempfile t_name' */
+ (void) printf("Rename of %s to %s failed after removing %s.\n%s not removed.\n",
+ tempfile, t_name, t_name, tempfile);
+ #endif
}
else
{
***************
*** 1024,1040 ****
register char *st, *cp;
if(!*newpath) return(FALSE); /* skip last directory attempt. */
- cp = memalloc(strlen(newpath) + 24);
- (void) sprintf(cp, "/bin/mkdir %s 2>/dev/null", newpath);
- if(verbose)
- (void) printf("calling mkdir: %s\n", cp);
if (noexec)
{
! (void) printf("%s\n", cp);
! free(cp);
return(TRUE);
}
! if (system(cp)) /* it failed.. */
{
(void) strcpy(cp, newpath); /* get current one. */
st = strrchr(cp, '/'); /* remove one more layer.. */
--- 1089,1105 ----
register char *st, *cp;
if(!*newpath) return(FALSE); /* skip last directory attempt. */
if (noexec)
{
! (void) printf("mkdir: %s\n", newpath);
return(TRUE);
}
! else if(verbose)
! (void) printf("mkdir: %s\n", newpath);
!
! cp = memalloc(strlen(newpath) + 24);
!
! if (mkdir(newpath)) /* it failed.. */
{
(void) strcpy(cp, newpath); /* get current one. */
st = strrchr(cp, '/'); /* remove one more layer.. */
***************
*** 1043,1055 ****
{
free(cp);
return(FALSE);
! } /* ok, so.. it passed on back. Try this again. */
! else if(makedir(newpath) == FALSE)
{
free(cp);
return(FALSE);
}
}
free(cp);
return(TRUE);
}
--- 1108,1122 ----
{
free(cp);
return(FALSE);
! }
! /* ok, so.. it passed on back. Try this again. */
! if(mkdir(newpath))
{
free(cp);
return(FALSE);
}
}
+
free(cp);
return(TRUE);
}
***************
*** 1057,1062 ****
--- 1124,1130 ----
/*--------------------------------------------------- strstr() --------------
/ find a substring within a string
/---------------------------------------------------------------------------*/
+ #ifndef OS2
char *
strstr(s1, s2)
register char *s1, *s2;
***************
*** 1084,1089 ****
--- 1152,1158 ----
*s = _tolower(*s);
return(op);
}
+ #endif
/*--------------------------------------------------- asciifile() -----------
/ check if passed file is an ascii file using file(1) command
***************
*** 1095,1100 ****
--- 1164,1183 ----
char cmdstr[256];
register FILE *fp;
+ #ifdef OS2
+ int file, cnt, i;
+
+ if ((file = open(fn, O_RDONLY|O_BINARY)) == -1)
+ return(FALSE);
+ cnt = read(file, cmdstr, sizeof(cmdstr)); /* get a block. */
+ close(file); /* and done. */
+
+ for ( i = 0; i < cnt; i++ )
+ if ( cmdstr[i] == 0 || cmdstr[i] == 127 )
+ return(FALSE);
+
+ return(TRUE);
+ #else /* OS2 */
(void) sprintf(cmdstr, "file %s", fn);
if (!(fp = popen(cmdstr, "r")))
return(FALSE);
***************
*** 1106,1111 ****
--- 1189,1195 ----
if (strstr(ftypestr, "text"))
return(TRUE);
return(FALSE);
+ #endif /* OS2 */
}
/*--------------------------------------------------- rcsfile() -------------
***************
*** 1118,1123 ****
--- 1202,1218 ----
char cmdstr[256];
register FILE *fp;
+ #ifdef OS2
+ if (!(fp = fopen(fn, "r")))
+ return(FALSE);
+ (void) strrd(ftypestr, 80, fp); /* get a line. */
+ (void) fclose(fp); /* and done. */
+ #ifdef DEBUG
+ (void) printf("%s\n", cmdstr);
+ #endif
+ if (strcmp(ftypestr, "head "))
+ return(TRUE);
+ #else /* OS2 */
(void) sprintf(cmdstr, "file %s", fn);
if (!(fp = popen(cmdstr, "r")))
return(FALSE);
***************
*** 1132,1137 ****
--- 1227,1233 ----
if (strstr(ftypestr, "sccs"))
#endif
return(TRUE);
+ #endif /* OS2 */
return(FALSE);
}
***************
*** 1263,1268 ****
--- 1359,1369 ----
(void) fprintf(stderr, "Cannot get working dir.\n");
exit(-1);
}
+ #ifdef OS2
+ /* strcpy(currentdir, currentdir + 2); */
+ UnixFileName(currentdir);
+ #endif
+ strcat(currentdir, "/");
s_currentdir = strlen(currentdir);
}
***************
*** 1280,1285 ****
--- 1381,1390 ----
register char *cp, *dp;
register int was_slash = FALSE;
+ #ifdef OS2
+ UnixFileName(cs);
+ #endif
+
cp = dp = cs;
while (isspace(*cp)) /* remove leading white spaces */
cp++;
***************
*** 1324,1333 ****
{
register char *cp = sdir;
! if(rcswrk && !strncmp(rcswrk, cp, s_rcswrk))
cp += s_rcswrk;
! if(homedir && !strncmp(homedir, cp, s_homedir))
cp += s_homedir;
/*
* build the final directory name
*/
--- 1429,1444 ----
{
register char *cp = sdir;
! if(rcswrk && !strnicmp(rcswrk, cp, s_rcswrk))
cp += s_rcswrk;
! if(homedir && !strnicmp(homedir, cp, s_homedir))
cp += s_homedir;
+ #ifdef OS2
+ if(isalpha(cp[0]) && cp[1] == ':')
+ cp += 2;
+ #endif
+ if(cp[0] == '/')
+ cp++;
/*
* build the final directory name
*/
***************
*** 1343,1350 ****
{
register char *cp = sdir;
! if (rcsdir && !strncmp(rcsdir, cp, s_rcsdir))
cp += s_rcsdir;
(void) sprintf(tdir, "%s%s", rcswrk ? rcswrk : homedir, cp);
}
--- 1454,1467 ----
{
register char *cp = sdir;
! if (rcsdir && !strnicmp(rcsdir, cp, s_rcsdir))
cp += s_rcsdir;
+ #ifdef OS2
+ if(isalpha(cp[0]) && cp[1] == ':')
+ cp += 2;
+ #endif
+ if(cp[0] == '/')
+ cp++;
(void) sprintf(tdir, "%s%s", rcswrk ? rcswrk : homedir, cp);
}
***************
*** 1357,1366 ****
{
register char *cp = sdir;
! if (rcsdir && !strncmp(rcsdir, cp, s_rcsdir))
! cp += s_rcsdir;
! if(homedir && !strncmp(homedir, cp, s_homedir))
cp += s_homedir;
(void) sprintf(tdir, "%s%s", srcdir ? srcdir : homedir, cp);
}
--- 1474,1489 ----
{
register char *cp = sdir;
! if (rcswrk && !strnicmp(rcswrk, cp, s_rcswrk))
! cp += s_rcswrk;
! if(homedir && !strnicmp(homedir, cp, s_homedir))
cp += s_homedir;
+ #ifdef OS2
+ if(isalpha(cp[0]) && cp[1] == ':')
+ cp += 2;
+ #endif
+ if(cp[0] == '/')
+ cp++;
(void) sprintf(tdir, "%s%s", srcdir ? srcdir : homedir, cp);
}
***************
*** 1375,1380 ****
--- 1498,1504 ----
int stat_loc;
(void) strcpy(name, tmpnam(editfile));
+ #ifndef OS2
if (fork())
{ /* parent just waits for the child to finish */
(void) wait(&stat_loc);
***************
*** 1383,1397 ****
{ /* child does his/her stuff */
(void) signal(SIGINT, SIG_DFL);
(void) signal(SIGQUIT, SIG_DFL);
exit(child_getfinput(name, type) == TRUE ? 0 : -1);
}
return((stat_loc >> 8) & 0xff);
}
/*--------------------------------------------------- child_getfinput() -----
/ actual get title file.
/---------------------------------------------------------------------------*/
! static int
child_getfinput(name, type)
char *name; /* buffer to put file name into. */
int type; /* what data we want. */
--- 1507,1526 ----
{ /* child does his/her stuff */
(void) signal(SIGINT, SIG_DFL);
(void) signal(SIGQUIT, SIG_DFL);
+ (void) signal(SIGBREAK, SIG_DFL);
+ (void) signal(SIGTERM, SIG_DFL);
exit(child_getfinput(name, type) == TRUE ? 0 : -1);
}
return((stat_loc >> 8) & 0xff);
+ #else
+ return child_getfinput(name, type) == TRUE ? 0 : -1;
+ #endif
}
/*--------------------------------------------------- child_getfinput() -----
/ actual get title file.
/---------------------------------------------------------------------------*/
! int
child_getfinput(name, type)
char *name; /* buffer to put file name into. */
int type; /* what data we want. */
***************
*** 1402,1408 ****
--- 1531,1539 ----
int c, done = FALSE;
char buf[82]; /* just larger than input buffer. */
+ #ifndef OS2
(void) setuid(real_user_id); /* user's real user id */
+ #endif
if((fp = fopen(name, "w")) == NULL) /* failed open. */
{
(void) unlink(name); /* remove it. */
***************
*** 1410,1416 ****
(void) printf("Unable to create tmp file.\n");
return(FALSE);
}
! (void) printf("Enter %s message, <ret>.<ret> or Control-D to end:\n",
input_type[type]);
while (!done)
{
--- 1541,1547 ----
(void) printf("Unable to create tmp file.\n");
return(FALSE);
}
! (void) printf("Enter %s message, <ret>.<ret> or Control-Z to end:\n",
input_type[type]);
while (!done)
{
***************
*** 1535,1540 ****
--- 1666,1674 ----
{
register char *cp;
+ #ifdef OS2
+ UnixFileName(fpath);
+ #endif
if (cp = strrchr(fpath, '/'))
return(++cp);
***************
*** 1617,1619 ****
--- 1751,1764 ----
}
/*----------------------------- End of cio.c -------------------------------*/
+
+ #ifdef OS2
+ UnixFileName(char *name)
+ {
+ /* strlwr(name); */
+ for ( ; *name; name++ )
+ if ( *name == '\\' )
+ *name = '/';
+ }
+ #endif
+