Skip to content
Snippets Groups Projects
Commit 4bbe2945 authored by rswindell's avatar rswindell
Browse files

Added support for -f option to *not* FTP-download distribution list (cause of

segfault on some systems).
Removed unnecessary CRs in printfs.
parent 79a48790
Branches
Tags
No related merge requests found
...@@ -128,6 +128,7 @@ char revision[16]; ...@@ -128,6 +128,7 @@ char revision[16];
int backup_level=5; int backup_level=5;
BOOL keep_makefile=FALSE; BOOL keep_makefile=FALSE;
BOOL ftp_distlist=TRUE;
/*************/ /*************/
/* Constants */ /* Constants */
...@@ -156,7 +157,7 @@ void bail(int code) ...@@ -156,7 +157,7 @@ void bail(int code)
void allocfail(uint size) void allocfail(uint size)
{ {
printf("\7Error allocating %u bytes of memory.\r\n",size); printf("\7Error allocating %u bytes of memory.\n",size);
bail(1); bail(1);
} }
...@@ -192,8 +193,8 @@ int main(int argc, char **argv) ...@@ -192,8 +193,8 @@ int main(int argc, char **argv)
sscanf("$Revision$", "%*s %s", revision); sscanf("$Revision$", "%*s %s", revision);
printf("\r\nSynchronet Installation %s-%s Copyright 2003 " printf("\nSynchronet Installation %s-%s Copyright 2003 "
"Rob Swindell\r\n",revision,PLATFORM_DESC); "Rob Swindell\n",revision,PLATFORM_DESC);
memset(&uifc,0,sizeof(uifc)); memset(&uifc,0,sizeof(uifc));
...@@ -217,6 +218,9 @@ int main(int argc, char **argv) ...@@ -217,6 +218,9 @@ int main(int argc, char **argv)
break; break;
case 'E': case 'E':
uifc.esc_delay=atoi(argv[i]+2); uifc.esc_delay=atoi(argv[i]+2);
break;
case 'F':
ftp_distlist=FALSE;
break; break;
case 'I': case 'I':
uifc.mode|=UIFC_IBM; uifc.mode|=UIFC_IBM;
...@@ -229,16 +233,17 @@ int main(int argc, char **argv) ...@@ -229,16 +233,17 @@ int main(int argc, char **argv)
default: default:
printf("\nusage: %s [ctrl_dir] [options]" printf("\nusage: %s [ctrl_dir] [options]"
"\n\noptions:\n\n" "\n\noptions:\n\n"
"-d = run in standard input/output/door mode\r\n" "-f = do not FTP distribution list\n"
"-c = force color mode\r\n" "-d = run in standard input/output/door mode\n"
"-c = force color mode\n"
#ifdef USE_CURSES #ifdef USE_CURSES
"-e# = set escape delay to #msec\r\n" "-e# = set escape delay to #msec\n"
"-i = force IBM charset\r\n" "-i = force IBM charset\n"
#endif #endif
#if !defined(__unix__) #if !defined(__unix__)
"-v# = set video mode to #\r\n" "-v# = set video mode to #\n"
#endif #endif
"-l# = set screen lines to #\r\n" "-l# = set screen lines to #\n"
,argv[0] ,argv[0]
); );
exit(0); exit(0);
...@@ -292,7 +297,7 @@ int main(int argc, char **argv) ...@@ -292,7 +297,7 @@ int main(int argc, char **argv)
sprintf(str,"Synchronet Installation %s-%s",revision,PLATFORM_DESC); sprintf(str,"Synchronet Installation %s-%s",revision,PLATFORM_DESC);
if(uifc.scrn(str)) { if(uifc.scrn(str)) {
printf(" USCRN (len=%d) failed!\r\n",uifc.scrn_len+1); printf(" USCRN (len=%d) failed!\n",uifc.scrn_len+1);
bail(1); bail(1);
} }
...@@ -651,7 +656,7 @@ get_distlist(void) ...@@ -651,7 +656,7 @@ get_distlist(void)
int s=0; int s=0;
char* p; char* p;
char* tp; char* tp;
ftp_FILE *list; ftp_FILE *list=NULL;
char sep[2]={'\t',0}; char sep[2]={'\t',0};
char str[1024]; char str[1024];
...@@ -687,6 +692,7 @@ get_distlist(void) ...@@ -687,6 +692,7 @@ get_distlist(void)
strcpy(file[f++],str); strcpy(file[f++],str);
} }
if(ftp_distlist) {
uifc.pop("Getting distributions"); uifc.pop("Getting distributions");
if((list=ftpGetURL(DIST_LIST_URL1,ftp_user,ftp_pass,&ret1))==NULL if((list=ftpGetURL(DIST_LIST_URL1,ftp_user,ftp_pass,&ret1))==NULL
&& (list=ftpGetURL(DIST_LIST_URL2,ftp_user,ftp_pass,&ret2))==NULL && (list=ftpGetURL(DIST_LIST_URL2,ftp_user,ftp_pass,&ret2))==NULL
...@@ -710,8 +716,9 @@ get_distlist(void) ...@@ -710,8 +716,9 @@ get_distlist(void)
); );
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
}
while((list->gets(in_line,sizeof(in_line),list))!=NULL) { while(list!=NULL && (list->gets(in_line,sizeof(in_line),list))!=NULL) {
i=strlen(in_line); i=strlen(in_line);
while(i>0 && in_line[i]<=' ') while(i>0 && in_line[i]<=' ')
in_line[i--]=0; in_line[i--]=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment