rem: ,file_area.lib_list[bbs.curlib].dir_list[i].name,"" 
add: ,file_area.lib_list[bbs.curlib].dir_list[i].description,"" 
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 '=':				bbs.curdir++;				if(bbs.curdir>=file_area.lib_list[bbs.cur_lib].dir_list.length)					bbs.curdir=0;				continue file_transfers;						case '<':			case '{':			case '-':				if(bbs.curdir<=0)					bbs.curdir=file_area.lib_list[bbs.cur_lib].dir_list.length;				bbs.curdir--;				continue file_transfers;							case ']':				bbs.curlib++;				if(bbs.curlib >= file_area.lib_list.length)					bbs.curlib=0;				continue file_transfers;			case '[':				if(bbs.curlib <= 0)					bbs.curlib=file_area.lib_list.length;				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();					}				}				/* ToDo					getfilespec					if_true						file_download	// See line 290 in execfile.cpp						end_if				*/				continue file_transfers;			case '/D':				/* ToDo: file_download_user				   see line 312 in execfile.cpp */				continue file_transfers;			case 'E':				console.putmsg("\r\nchList Extended File Information\r\n");				str=bbs.get_filespec();				if(str==null)					continue file_transfers;				str=str.replace(/^(.*)(\..*)?$/,					function(s, p1, p2, oset, s) {						if(p2==undefined)							return(format("%-8.8s    ",p1));						return(format("%-8.8s%-4.4s",p1,p2));					}				);				/* ToDo					file_list_extended					See execfile.cpp:406 */				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':				/* ToDo: execfile.cpp:50 */				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 && console.yesno(bbs.text(DownloadBatchQ))) {					bbs.batch_download();					bbs.logout();				}				continue file_transfers;			case 'R':				console.putmsg("\r\nchRemove/Edit File(s)\r\n");				/* ToDo: execfile.cpp:452				getfilespec				if_true					file_remove					end_if */				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");				if(file_exists(system.text_dir+"menu/upload.*"))					bbs.menu("upload");				if(file_area.lib_list.length) {					if(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].can_upload)						i=file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number;					/* else  ToDo: cfg.upload_dir not available to JS */				}				/* else  ToDo: cfg.upload_dir not available to JS */				bbs.upload_file(i);				continue file_transfers;			case '/U':				console.putmsg("\r\nchUpload File to User\r\n");				/* ToDo: file_upload_user				   (user_dir not available) */				continue file_transfers;			case 'V':				console.putmsg("\r\nchView File(s)\r\n");				/* ToDo execfile.cpp:370				getfilespec				if_true					file_view					end_if				end_cmd */				continue file_transfers;			case 'Z':				console.putmsg("\r\nchUpload File to Sysop\r\n");				/* ToDo: sysop_dir not available 				file_upload_sysop */				continue file_transfers;			case '*':				if(!file_areas.lib_list.length)					continue file_transfers;				str=format("%smenu/dirs%u.*", system.text_dir, file_areas.lib_list[bbs.curlib].number+1);				if(file_exist(str)) {					str=format("menu/dirs%u.*", file_areas.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].name),P_SAVEATR);				for(i=0;i<file_area.lib_list[bbs.curlib].dir_list.length;i++) {					if(i==bbs.curdir)						outchar('*');					else						outchar(' ');					str=format(bbs.text(DirLstFmt),i+1						,file_area.lib_list[bbs.curlib].dir_list[i].name,""						/* ToDo: getfiles not implemented */						,-1);					if(i<9)						console.putmsg(' ');					if(i<99)						console.putmsg(' ');					console.putmsg(str);				}				continue file_transfers;			case '*':				/* ToDo: execfile.cpp:200					file_show_directories					end_cmd	*/				continue file_transfers;			case '/*':				/* ToDo execfile.cpp:184					file_show_libraries					end_cmd */				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/24c18ddd4570b881640d5882b00140ca1da07d1c/classic_shell.js/buggy/classic_shell.js