Commit 0a4f9206 authored by deuce's avatar deuce
Browse files

Use fexistcase() on user.dat file.

parent 1cb55739
......@@ -13,6 +13,8 @@
#include <stdlib.h>
#include <sys/stat.h>
#include "dirwrap.h"
#include "sbbsdefs.h"
int min=0,max=99;
......@@ -189,8 +191,8 @@ for(i=1;i<argc;i++) {
for(;argv[i][j];j++)
if(isalpha(argv[i][j]))
flags|=FLAG(toupper(argv[i][j]));
sprintf(str,"%sUSER.DAT",dir);
if((file=sopen(str,O_RDWR|O_BINARY,SH_DENYNO))==-1) {
sprintf(str,"%suser.dat",dir);
if(!fexistcase(str) || (file=sopen(str,O_RDWR|O_BINARY,SH_DENYNO))==-1) {
printf("Error opening %s\n",str);
exit(1); }
if((stream=fdopen(file,"w+b"))==NULL) {
......@@ -246,8 +248,8 @@ for(i=1;i<argc;i++) {
for(;argv[i][j];j++)
if(isalpha(argv[i][j]))
flags|=FLAG(toupper(argv[i][j]));
sprintf(str,"%sUSER.DAT",dir);
if((file=sopen(str,O_RDWR|O_BINARY,SH_DENYNO))==-1) {
sprintf(str,"%suser.dat",dir);
if(!fexistcase(str) || (file=sopen(str,O_RDWR|O_BINARY,SH_DENYNO))==-1) {
printf("Error opening %s\n",str);
exit(1); }
if((stream=fdopen(file,"w+b"))==NULL) {
......@@ -295,8 +297,8 @@ for(i=1;i<argc;i++) {
j=99;
if(j<0)
j=0;
sprintf(str,"%sUSER.DAT",dir);
if((file=sopen(str,O_RDWR|O_BINARY,SH_DENYNO))==-1) {
sprintf(str,"%suser.dat",dir);
if(!fexistcase(str) || (file=sopen(str,O_RDWR|O_BINARY,SH_DENYNO))==-1) {
printf("Error opening %s\n",str);
exit(1); }
if((stream=fdopen(file,"w+b"))==NULL) {
......@@ -334,7 +336,6 @@ for(i=1;i<argc;i++) {
exit(1); }
else {
strcpy(dir,argv[i]);
if(dir[strlen(dir)-1]!='\\' && dir[strlen(dir)-1]!=':')
strcat(dir,"\\"); } }
backslash(dir);
return(0);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment