rem: console.putmsg(bbs.text(NFilesListed,i),P_SAVEATR); 
add: console.putmsg(format(bbs.text(NFilesListed),i),P_SAVEATR); 
context: function file_transfers(){	var key;	if(user.compare_ars("file_cmds=0")) {		if(user.settings & USER_ASK_NSCAN) {			console.crlf();			console.crlf();			if(console.yesno("Search all libraries for new files"))				bbs.scan_dirs(FL_ULTIME, true);		}	}file_transfers:	while(1) {		if(!(user.settings & USER_EXPERT)) {			console.clear();			bbs.menu("transfer");		}		// Update node status		bbs.node_action=NODE_XFER;		// async		bbs.file_cmds++;		// Display main Prompt		console.putmsg("-c\r\n bhFile nc h");		if(user.compare_ars("exempt T"))			console.putmsg("@TUSED@",P_SAVEATR);		else			console.putmsg("@TLEFT@",P_SAVEATR);		console.putmsg(" nc(h@LN@nc) @LIB@ (h@DN@nc) @DIR@: n");		// Get key (with / extended commands allowed)		str=get_next_key();		if(user.compare_ars("RIP"))			console.getlines();		// Do nothing for control keys and space		switch(str) {			case "\001":			case "\015":			case "\023":			case " ":				continue file_transfers;		}		// Write command to log file		bbs.log_key(str,true);		// Hitting number changes current sub-board		switch(str) {			case "1":			case "2":			case "3":			case "4":			case "5":			case "6":			case "7":			case "8":			case "9":				bbs.curdir=get_next_num(file_area.lib_list[bbs.curlib].dir_list.length,true);				continue file_transfers;		// Hitting /number changes current group			case "/1":			case "/2":			case "/3":			case "/4":			case "/5":			case "/6":			case "/7":			case "/8":			case "/9":				bbs.curlib=get_next_num(file_area.lib_list.length,true)-1;				continue file_transfers;		}		// Show the key hit		if(!(user.settings & USER_COLDKEYS))			printf(str);		switch(str) {			case '>':			case '}':			case '+':			case '=':				if(bbs.curdir>=file_area.lib_list[bbs.curlib].dir_list.length-1)					bbs.curdir=0;				else					bbs.curdir++;				continue file_transfers;						case '<':			case '{':			case '-':				if(bbs.curdir==0)					bbs.curdir=file_area.lib_list[bbs.curlib].dir_list.length-1;				else					bbs.curdir--;				continue file_transfers;							case ']':				if(bbs.curlib == file_area.lib_list.length-1)					bbs.curlib=0;				else					bbs.curlib++;				continue file_transfers;			case '[':				if(bbs.curlib == 0)					bbs.curlib=file_area.lib_list.length-1;				else					bbs.curlib--;				continue file_transfers;			// String commands start with a semicolon			case ';':				// Difference from default.src... do NOT force upper-case!				// Upper-case pisses of *nix people.				str=get_next_str("",40,0,false);				str_cmds(str);				continue file_transfers;			case 'Q':				return;		}		if(!(user.settings & USER_COLDKEYS))			console.crlf();		console.line_counter=0;		// Menu		switch(str) {			case '?':				if(user.settings & USER_EXPERT)					bbs.menu("transfer");				continue file_transfers;		}		if(user.compare_ars("SYSOP")) {			switch(str) {				case '!':					bbs.menu("sysxfer");					continue file_transfers;			}		}				// Commands		switch(str) {			case 'B':				bbs.batch_menu();				continue file_transfers;			case 'C':				load("chat_sec.js");				continue file_transfers;			case 'D':				console.putmsg("\r\nchDownload File(s)\r\n");				if(bbs.batch_dnload_total>0) {					if(console.yesno(bbs.text(DownloadBatchQ))) {						bbs.batch_download();						continue file_transfers;					}				}				str=bbs.get_filespec();				if(str==null)					continue file_transfers;				if(file_area.lib_list.length==0)					continue file_transfers;				if(user.security.restrictions&UFLAG_D) {					console.putmsg(bbs.text(R_Download));					continue file_transfers;				}				if(!bbs.list_file_info(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number, str, FI_DOWNLOAD)) {					var s=0;					console.putmsg(bbs.text(SearchingAllDirs));					for(i=0; i<file_area.lib_list[bbs.curlib].dir_list.length; i++) {						if(i!=bbs.curdir &&								(s=bbs.list_file_info(file_area.lib_list[bbs.curlib].dir_list[i].number, str, FI_DOWNLOAD))!=0) {							if(s==-1 || str.indexOf('?')!=-1 || str.indexOf('*')!=-1) {								continue file_transfers;							}						}					}					console.putmsg(bbs.text(SearchingAllLibs));					for(i=0; i<file_area.lib_list.length; i++) {						if(i==bbs.curlib)							continue;						for(j=0; j<file_area.lib_list[i].dir_list.length; j++) {							if((s=bbs.list_file_info(file_area.lib_list[i].dir_list[j].number, str, FI_DOWNLOAD))!=0) {								if(s==-1 || str.indexOf('?')!=-1 || str.indexOf('*')!=-1) {									continue file_transfers;								}							}						}					}				}				continue file_transfers;			case '/D':				if(file_area.user_dir==undefined)					console.putmsg(bbs.text(NoUserDir));				else {					if(user.compare_ars("rest D"))						console.putmsg(bbs.text(R_Download));					else {						console.crlf();						if(!bbs.list_file_info(file_area.user_dir, FI_USERXFER))							console.putmsg(bbs.text(NoFilesForYou));					}				}				continue file_transfers;			case 'E':				console.putmsg("\r\nchList Extended File Information\r\n");				str=bbs.get_filespec();				if(str==null)					continue file_transfers;				if(!bbs.list_file_info(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number, str, FI_INFO)) {					var s=0;					console.putmsg(bbs.text(SearchingAllDirs));					for(i=0; i<file_area.lib_list[bbs.curlib].dir_list.length; i++) {						if(i!=bbs.curdir &&								(s=bbs.list_file_info(file_area.lib_list[bbs.curlib].dir_list[i].number, str, FI_INFO))!=0) {							if(s==-1 || str.indexOf('?')!=-1 || str.indexOf('*')!=-1) {								continue file_transfers;							}						}					}					console.putmsg(bbs.text(SearchingAllLibs));					for(i=0; i<file_area.lib_list.length; i++) {						if(i==bbs.curlib)							continue;						for(j=0; j<file_area.lib_list[i].dir_list.length; j++) {							if((s=bbs.list_file_info(file_area.lib_list[i].dir_list[j].number, str, FI_INFO))!=0) {								if(s==-1 || str.indexOf('?')!=-1 || str.indexOf('*')!=-1) {									continue file_transfers;								}							}						}					}				}				continue file_transfers;			case 'F':				console.putmsg("\r\nchFind Text in File Descriptions (no wildcards)\r\n");				bbs.scan_dirs(FL_FINDDESC);				continue file_transfers;			case '/F':				bbs.scan_dirs(FL_FINDDESC,true);				continue file_transfers;						case 'I':				file_info();				continue file_transfers;			case 'J':				if(!file_area.lib_list.length)					continue file_transfers;				while(1) {					var orig_lib=bbs.curlib;					var i=0;					var j=0;					if(file_area.lib_list.length>1) {						if(file_exists(system.text_dir+"menu/libs.*"))							bbs.menu("libs");						else {							console.putmsg(bbs.text(CfgLibLstHdr),P_SAVEATR);							for(i=0; i<file_area.lib_list.length; i++) {								if(i==bbs.curlib)									console.putmsg('*',P_SAVEATR);								else									console.putmsg(' ',P_SAVEATR);								if(i<9)									console.putmsg(' ',P_SAVEATR);								if(i<99)									console.putmsg(' ',P_SAVEATR);								// We use console.putmsg to expand ^A, @, etc								console.putmsg(format(bbs.text(CfgLibLstFmt),i+1,file_area.lib_list[i].description),P_SAVEATR);							}						}						console.mnemonics(format(bbs.text(JoinWhichLib),bbs.curlib+1));						j=get_next_num(file_area.lib_list.length,false);						if(j<0)							continue file_transfers;						if(!j)							j=bbs.curlib;						else							j--;					}					bbs.curlib=j;					if(file_exists(system.text_dir+"menu/dirs"+(bbs.curlib+1)))						bbs.menu("dirs"+(bbs.curlib+1));					else {						console.clear();						console.putmsg(format(bbs.text(DirLstHdr), file_area.lib_list[j].description),P_SAVEATR);						for(i=0; i<file_area.lib_list[j].dir_list.length; i++) {							if(i==bbs.curdir)								console.putmsg('*',P_SAVEATR);							else								console.putmsg(' ',P_SAVEATR);							if(i<9)								console.putmsg(' ',P_SAVEATR);							if(i<99)								console.putmsg(' ',P_SAVEATR);							console.putmsg(format(bbs.text(DirLstFmt),i+1, file_area.lib_list[j].dir_list[i].description,"",todo_getfiles(j,i)),P_SAVEATR);						}					}					console.mnemonics(format(bbs.text(JoinWhichDir),bbs.curdir+1));					i=get_next_num(file_area.lib_list[j].dir_list.length,false);					if(i==-1) {						if(file_area.lib_list.length==1) {							bbs.curlib=orig_lib;							continue file_transfers;						}						continue;					}					if(!i)						i=bbs.curdir;					else						i--;					bbs.curdir=i;					continue file_transfers;				}				// This never actually happens...				continue file_transfers;			case 'L':				i=bbs.list_files();				if(i==-1)					continue file_transfers;				if(i==0)					console.putmsg(bbs.text(EmptyDir),P_SAVEATR);				else					console.putmsg(bbs.text(NFilesListed,i),P_SAVEATR);				continue file_transfers;			case '/L':				bbs.list_nodes();				continue file_transfers;			case 'N':				console.putmsg("\r\nchNew File Scan\r\n");				bbs.scan_dirs(FL_ULTIME);				continue file_transfers;			case '/N':				bbs.scan_dirs(FL_ULTIME,true);				continue file_transfers;			case 'O':				if(bbs.batch_dnload_total && console.yesno(bbs.text(DownloadBatchQ))) {					bbs.batch_download();					bbs.logoff();				}				continue file_transfers;			case '/O':				if(bbs.batch_dnload_total) {					if(console.yesno(bbs.text(DownloadBatchQ))) {						bbs.batch_download();						bbs.hangup();					}				}				else					bbs.hangup();				continue file_transfers;			case 'R':				console.putmsg("\r\nchRemove/Edit File(s)\r\n");				str=bbs.get_filespec();				if(str==null)					continue file_transfers;				if(!bbs.list_file_info(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number, str, FI_REMOVE)) {					var s=0;					console.putmsg(bbs.text(SearchingAllDirs));					for(i=0; i<file_area.lib_list[bbs.curlib].dir_list.length; i++) {						if(i!=bbs.curdir &&								(s=bbs.list_file_info(file_area.lib_list[bbs.curlib].dir_list[i].number, str, FI_REMOVE))!=0) {							if(s==-1 || str.indexOf('?')!=-1 || str.indexOf('*')!=-1) {								continue file_transfers;							}						}					}					console.putmsg(bbs.text(SearchingAllLibs));					for(i=0; i<file_area.lib_list.length; i++) {						if(i==bbs.curlib)							continue;						for(j=0; j<file_area.lib_list[i].dir_list.length; j++) {							if((s=bbs.list_file_info(file_area.lib_list[i].dir_list[j].number, str, FI_REMOVE))!=0) {								if(s==-1 || str.indexOf('?')!=-1 || str.indexOf('*')!=-1) {									continue file_transfers;								}							}						}					}				}				continue file_transfers;			case 'S':				console.putmsg("\r\nchSearch for Filename(s)\r\n");				bbs.scan_dirs(FL_NO_HDR);				continue file_transfers;			case '/S':				bbs.scan_dirs(FL_NO_HDR,true);				continue file_transfers;			case 'T':				bbs.temp_xfer();				continue file_transfers;			case 'U':				console.putmsg("\r\nchUpload File\r\n");				i=0xffff;	/* INVALID_DIR */				if(file_exists(system.text_dir+"menu/upload.*"))					bbs.menu("upload");				if(file_area.lib_list.length) {					i=file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number;					if(file_area.upload_dir != undefined && !file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].can_upload)						i=file_area.upload_dir.number;				}				else {					if(file_area.upload_dir != undefined)						i=file_area.upload_dir.number;				}				bbs.upload_file(i);				continue file_transfers;			case '/U':				console.putmsg("\r\nchUpload File to User\r\n");				if(file_area.upload_dir == undefined)					console.putmsg(bbs.text(NoUserDir));				else					bbs.upload_file(file_area.upload_dir.number);				continue file_transfers;			case 'V':				console.putmsg("\r\nchView File(s)\r\n");				str=bbs.get_filespec();				if(str==null)					continue file_transfers;				if(!bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number, str, FL_VIEW)) {					console.putmsg(bbs.text(SearchingAllDirs));					for(i=0; i<file_area.lib_list[bbs.curlib].dir_list.length; i++) {						if(i==bbs.curdir)							continue;						if(bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[i].number, str, FL_VIEW))							break;					}					if(i<file_area.lib_list[bbs.curlib].dir_list.length)						continue file_transfers;					console.putmsg(bbs.text(SearchingAllLibs));					for(i=0; i<file_area.lib_list.length; i++) {						if(i==bbs.curlib)							continue;						for(j=0; j<file_area.lib_list[i].dir_list.length; j++) {							if(bbs.list_files(file_area.lib_list[i].dir_list[j].number, str, FL_VIEW))								continue file_transfers;						}					}				}				continue file_transfers;			case 'Z':				console.putmsg("\r\nchUpload File to Sysop\r\n");				if(file_area.sysop_dir == undefined)					console.putmsg(bbs.text(NoSysopDir));				else					bbs.upload_file(file_area.sysop_dir.number);				continue file_transfers;			case '*':				if(!file_area.lib_list.length)					continue file_transfers;				str=format("%smenu/dirs%u.*", system.text_dir, file_area.lib_list[bbs.curlib].number+1);				if(file_exists(str)) {					str=format("menu/dirs%u.*", file_area.lib_list[bbs.curlib].number+1);					bbs.menu(str);					continue file_transfers;				}				console.crlf();				console.putmsg(format(bbs.text(DirLstHdr),file_area.lib_list[bbs.curlib].descirption),P_SAVEATR);				for(i=0;i<file_area.lib_list[bbs.curlib].dir_list.length;i++) {					if(i==bbs.curdir)						console.putmsg('*');					else						console.putmsg(' ');					str=format(bbs.text(DirLstFmt),i+1						,file_area.lib_list[bbs.curlib].dir_list[i].description,""						,todo_getfiles(bbs.curlib,i));					if(i<9)						console.putmsg(' ');					if(i<99)						console.putmsg(' ');					console.putmsg(str);				}				continue file_transfers;			case '/*':				if(!file_area.lib_list.length)					continue file_transfers;				if(file_exists(system.text_dir+'menu/libs.*')) {					bbs.menu('libs');					continue file_transfers;				}				console.putmsg(bbs.text(LibLstHdr),P_SAVEATR);				for(i=0;i<file_area.lib_list.length;i++) {					if(i==bbs.curlib)						console.putmsg('*');					else						console.putmsg(' ');					if(i<9)						console.putmsg(' ');					console.putmsg(format(bbs.text(LibLstFmt),i+1,file_area.lib_list[i].description,"",file_area.lib_list[i].dir_list.length));				}				continue file_transfers;			case '&':xfercfg:				while(1) {					if(!(user.settings & USER_EXPERT))						bbs.menu(xfercfg);					// async					console.putmsg("\r\nyhConfig: n",P_SAVEATR);					key=get_next_keys("?QBEP\r");					bbs.log_key(key);					switch(key) {						case '?':							if(user.settings & USER_EXPERT)								bbs.menu("xfercfg");							break;						case 'P':							bbs.get_newscantime(bbs.new_file_time);							break;						case 'B':							user.settings ^= USER_BATCHFLAG;							break;						case 'E':							user.settings ^= USER_EXTDESC;							break;						default:							break xfercfg;					}				}				continue file_transfers;			case '#':				console.putmsg("\r\nchType the actual number, not the symbol.\r\n");				continue file_transfers;			case '/#':				console.putmsg("\r\nchType the actual number, not the symbol.\r\n");				continue file_transfers;			default:				// fall through				console.putmsg("\r\nchUnrecognized command.",P_SAVEATR);				if(user.settings & USER_EXPERT)					console.putmsg(" Hit 'i?nch' for a menu.");		}		console.crlf();	}	// shouldn't hit next line	alert("Problem in command shell.");	console.pause();	bbs.hangup();}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/7725dd9cfd6defe4664a4532784e709e94c952e3/classic_shell.js/buggy/classic_shell.js