Commit 79a7ae79 authored by rswindell's avatar rswindell
Browse files

More use of new get_ctrl_dir() function.

parent ea4d8173
......@@ -263,9 +263,9 @@ $(SMBACTIV): $(SMBACTIV_OBJS)
$(QUIET)$(CC) $(CONSOLE_LDFLAGS) -o $@ $(SMBACTIV_OBJS) $(SMBLIB_LIBS) $(XPDEV_LIBS) $(ENCODE_LIBS) $(HASH_LIBS)
# DSTSEDIT
$(DSTSEDIT): $(DSTSEDIT_OBJS)
$(DSTSEDIT): $(DSTSEDIT_OBJS) $(ENCODE_LIB)
@echo Linking $@
$(QUIET)$(CC) $(CONSOLE_LDFLAGS) -o $@ $(DSTSEDIT_OBJS) $(XPDEV_LIBS)
$(QUIET)$(CC) $(CONSOLE_LDFLAGS) -o $@ $(DSTSEDIT_OBJS) $(XPDEV_LIBS) $(ENCODE_LIBS)
# READSAUCE
$(READSAUCE): $(READSAUCE_OBJS) $(OBJODIR) $(EXEODIR)
......
......@@ -48,7 +48,7 @@ main(int argc, char **argv)
{
char ch, str[MAX_PATH+1], path[MAX_PATH + 1]
,*lst = "%c) %-25s: %13lu\n"
,*nv = "\nNew value: ", *p;
,*nv = "\nNew value: ";
int file;
stats_t stats;
time32_t t;
......@@ -56,14 +56,10 @@ main(int argc, char **argv)
memset(&cfg, 0, sizeof(cfg));
if (argc > 1)
strcpy(path, argv[1]);
else {
p=getenv("SBBSCTRL");
if(p)
SAFECOPY(path, p);
else
getcwd(path, sizeof(path));
if (argc > 1) {
SAFECOPY(path, argv[1]);
} else {
SAFECOPY(path, get_ctrl_dir());
}
backslash(path);
......
......@@ -1196,12 +1196,7 @@ int main(int argc, char** argv)
loginAttemptListInit(&login_attempt_list);
ctrl_dir=getenv("SBBSCTRL"); /* read from environment variable */
if(ctrl_dir==NULL || ctrl_dir[0]==0) {
ctrl_dir="\\sbbs\\ctrl"; /* Not set? Use default */
printf("!SBBSCTRL environment variable not set, using default value: %s\n\n"
,ctrl_dir);
}
ctrl_dir = get_ctrl_dir();
sbbs_get_ini_fname(ini_file, ctrl_dir, NULL /* auto-host_name */);
......
......@@ -336,6 +336,7 @@ SMBACTIV_OBJS = \
DSTSEDIT_OBJS = \
$(OBJODIR)$(DIRSEP)dstsedit$(OFILE)\
$(OBJODIR)$(DIRSEP)date_str$(OFILE) \
$(OBJODIR)$(DIRSEP)str_util$(OFILE) \
$(OBJODIR)$(DIRSEP)nopen$(OFILE)
READSAUCE_OBJS = \
......
......@@ -6144,13 +6144,7 @@ int main(int argc, char **argv)
if(!opt_import_echomail && !opt_import_netmail)
opt_import_packets = false;
p=getenv("SBBSCTRL");
if(p==NULL) {
printf("\7\nSBBSCTRL environment variable not set.\n");
bail(1);
return -1;
}
SAFECOPY(scfg.ctrl_dir,p);
SAFECOPY(scfg.ctrl_dir, get_ctrl_dir());
backslash(scfg.ctrl_dir);
......
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