rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
13
136k
meta
stringlengths
132
347
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
167 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/167/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
2069 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2069/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/railties/html/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
2069 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2069/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/railties/html/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
1604 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1604/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/railties/html/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
1604 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1604/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/railties/html/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
1534 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1534/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
1534 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1534/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
5521 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5521/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/railties/html/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
5521 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5521/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/railties/html/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
107 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/107/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/railties/html/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
107 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/107/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/railties/html/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
2338 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2338/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
2338 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2338/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
949 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/949/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
949 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/949/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
1534 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1534/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/railties/html/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
1534 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1534/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/railties/html/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
269 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/269/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
269 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/269/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
6649 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6649/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
6649 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6649/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
5523 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5523/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
5523 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5523/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
5521 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5521/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
5521 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5521/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
4687 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4687/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/railties/html/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
4687 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4687/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/clean/railties/html/javascripts/prototype.js
if (e != _continue) throw e;
if (e != $continue) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
949 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/949/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/railties/html/javascripts/prototype.js
if (e != _break) throw e;
if (e != $break) throw e;
each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != _continue) throw e; } }); } catch (e) { if (e != _break) throw e; } },
949 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/949/7d101d58400acaff232091485c8e140f0a37cbaf/prototype.js/buggy/railties/html/javascripts/prototype.js
break;
status_line();
function edit(quote_first){ var key; redraw_screen(); if(quote_first) { if(quote_mode()) return; } while(1) { set_cursor(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A (Colour) */ key=''; draw_colour_box(); while(key=='') { key=console.getkey(K_UPPER); switch(key) { case 'K': curattr&=0xf8; break; case 'R': curattr=(curattr&0xf8)|RED; break; case 'G': curattr=(curattr&0xf8)|GREEN; break; case 'Y': curattr=(curattr&0xf8)|BROWN; break; case 'B': curattr=(curattr&0xf8)|BLUE; break; case 'M': curattr=(curattr&0xf8)|MAGENTA; break; case 'C': curattr=(curattr&0xf8)|CYAN; break; case 'W': curattr=(curattr&0xf8)|LIGHTGRAY; break; case '0': curattr=(curattr&0x8f); break; case '1': curattr=(curattr&0x8f)|(RED<<4); break; case '2': curattr=(curattr&0x8f)|(GREEN<<4); break; case '3': curattr=(curattr&0x8f)|(BROWN<<4); break; case '4': curattr=(curattr&0x8f)|(BLUE<<4); break; case '5': curattr=(curattr&0x8f)|(MAGENTA<<4); break; case '6': curattr=(curattr&0x8f)|(CYAN<<4); break; case '7': curattr=(curattr&0x8f)|(LIGHTGRAY<<4); break; case 'H': curattr|=0x08; break; case 'I': curattr|=0x80; break; case 'N': curattr=7; break; case ctrl('R'): redraw_screen(); key=''; break; case "\x1b": /* ESC */ break; default: console.beep(); key=''; break; } } status_line(); erase_colour_box(); break; case '\x02': /* CTRL-B KEY_HOME */ last_xpos=-1; xpos=0; break; case '\x03': /* CTRL-C (Center Line) */ last_xpos=-1; line[ypos].hardcr=true; /* Trim leading/trailing whitespace */ line[ypos].text=line[ypos].text.replace(/^(\s*)(.*?)\s*$/,function (str, leading, t, offset, s) { line[ypos].attr=line[ypos].attr.substr(leading.length, t.length); xpos -= leading.length; if(xpos<0) xpos=0; return(t); }); var add=parseInt((80-line[ypos].text.length)/2); for(add=parseInt((80-line[ypos].text.length)/2); add>0; add--) { line[ypos].text=' '+line[ypos].text; line[ypos].attr=ascii(curattr)+line[ypos].attr; xpos++; } if(xpos>line[ypos].length) xpos=line[ypos].length; draw_line(ypos); break; case '\x04': /* CTRL-D (Quick Find in SyncEdit)*/ break; case '\x05': /* CTRL-E KEY_END */ last_xpos=-1; xpos=line[ypos].text.length; break; case '\x06': /* CTRL-F KEY_RIGHT */ last_xpos=-1; xpos++; if(xpos>line[ypos].text.length) { xpos--; console.beep(); } if(xpos>line[ypos].text.length) { if(line[ypos].hardcr) console.beep(); else { if(try_next_line()) x=0; } } break; case '\x07': /* CTRL-G (Beep) */ /* Enter Graphic Character */ key=get_graphic(); if(key=='') break; add_char(key); break; case '\x08': /* CTRL-H Backspace */ last_xpos=-1; if(xpos>0) { line[ypos].text=line[ypos].text.substr(0,xpos-1) +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos-1) +line[ypos].attr.substr(xpos); xpos--; } else { if(try_prev_line()) { xpos=line[ypos].text.length; line[ypos].hardcr=false; } } if(!rewrap()) draw_line(ypos,xpos); break; case '\x09': /* CTRL-I TAB... ToDo expand to spaces */ add_char(' '); while(xpos%8) add_char(' '); break; case '\x0a': /* CTRL-J KEY_DOWN (Insert Line in SyncEdit) */ if(last_xpos==-1) last_xpos=xpos; try_next_line(); break; case '\x0b': /* CTRL-K */ console.attributes=7; console.gotoxy(1,edit_top); console.write("Editing keys:"); console.cleartoeol(); console.write("\r\n CTRL-A - Change Colour CTRL-Q - Quick Abort (no save)"); console.cleartoeol(); console.write("\r\n CTRL-B - Move to beginning of line CTRL-R - Redraw screen"); console.cleartoeol(); console.write("\r\n CTRL-C - Center line on screen CTRL-T - Edit title"); console.cleartoeol(); console.write("\r\n CTRL-E - Move to end of line CTRL-U - Enter quote mode"); console.cleartoeol(); console.write("\r\n CTRL-F - Move right one character CTRL-V - Toggle insert mode"); console.cleartoeol(); console.write("\r\n CTRL-G - Enter graphic character CTRL-W - Delete word backwards"); console.cleartoeol(); console.write("\r\n CTRL-H - Backspace (BACKSPACE) CTRL-Y - Delete Line"); console.cleartoeol(); console.write("\r\n CTRL-I - Move to next tabstop (TAB) CTRL-Z - Save message and exit"); console.cleartoeol(); console.write("\r\n CTRL-J - Move down one line CTRL-] - Move left one character"); console.cleartoeol(); console.write("\r\n CTRL-L - Insert Line CTRL-^ - Move up one line"); console.cleartoeol(); console.write("\r\n CTRL-O - Page Up CTRL-_ - Quick Abort (no save)"); console.cleartoeol(); console.write("\r\n CTRL-P - Page Down CTRL-_ - Quick Abort (no save)"); console.cleartoeol(); console.write('\r\n'); console.cleartoeol(); console.write('\r\n'); console.write("Press any key to return to editing.."); console.cleartoeol(); console.write('\r\n'); console.cleartoeol(); console.up(); console.right(37); console.getkey(); redraw_screen(); break; case '\x0c': /* CTRL-L (Insert Line) */ /* ToDo: Should this kill last_xpos? */ add_new_line_below(ypos-1); xpos=0; break; case '\x0d': /* CTRL-M CR */ last_xpos=-1; if(insert) { add_new_line_below(ypos); /* Move all this to the next line... */ line[ypos+1].text=line[ypos].text.substr(xpos); line[ypos+1].attr=line[ypos].attr.substr(xpos); line[ypos+1].hardcr=line[ypos].hardcr; line[ypos].text=line[ypos].text.substr(0,xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos); line[ypos].hardcr=true; draw_line(ypos,xpos); if(line[ypos].kludged) { line[ypos+1].kludged=true; line[ypos].kludged=false; } draw_line(ypos+1); } try_next_line(); xpos=0; rewrap(); break; case '\x0e': /* CTRL-N */ break; case '\x0f': /* CTRL-O (Quick Save/exit in SyncEdit) */ if(last_xpos==-1) last_xpos=xpos; if(ypos==0) { console.beep(); break; } ypos-=lines_on_screen-1; if(ypos<0) ypos=0; if(topline>ypos) topline=ypos; var i; for(i=edit_top; i<=edit_bottom; i++) draw_line(i-edit_top+topline); xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; break; case '\x10': /* CTRL-P */ if(last_xpos==-1) last_xpos=xpos; if(ypos>=line.length-1) { console.beep(); break; } ypos+=lines_on_screen-1; if(ypos>line.length-1) ypos=line.length-1; if(ypos>=topline+lines_on_screen) topline=ypos-lines_on_screen+1; var i; for(i=edit_top; i<=edit_bottom; i++) draw_line(i-edit_top+topline); xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; break; case '\x11': /* CTRL-Q (XOff) (Quick Abort in SyncEdit) */ return; case '\x12': /* CTRL-R (Quick Redraw in SyncEdit) */ redraw_screen(); break; case '\x13': /* CTRL-S (Xon) */ break; case '\x14': /* CTRL-T (Justify Line in SyncEdit) */ if(edit_top==5) { console.gotoxy(7,1); var newsubj=console.getstr(subj, 70, K_LINE|K_EDIT|K_AUTODEL); if(newsubj!='') subj=newsubj; redraw_screen(); } break; case '\x15': /* CTRL-U (Quick Quote in SyncEdit) */ if(quote_line.length>0) { if(quote_mode()) return; } else console.beep(); break; case '\x16': /* CTRL-V (Toggle insert mode) */ insert=!insert; status_line(); break; case '\x17': /* CTRL-W (Delete Word) */ last_xpos=-1; /* Remove trailing part of word */ while(line[ypos].text.length>xpos && line[ypos].text.substr(xpos,1).search(/\s/)==-1) { line[ypos].text=line[ypos].text.substr(0,xpos) +line[ypos].text.substr(xpos+1); line[ypos].attr=line[ypos].attr.substr(0,xpos) +line[ypos].attr.substr(xpos+1); } /* Remove leading part */ while(xpos>0 && line[ypos].text.substr(xpos-1,1).search(/\s/)==-1) { line[ypos].text=line[ypos].text.substr(0,xpos-1) +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos-1) +line[ypos].attr.substr(xpos); xpos--; } /* * Remove Space... * Note that no matter what, we should delete a space. * We're either deleting the space from the end of the word if * this was the first word on the line, or the one before the * word otherwise. This puts the cursor on the previous word * if there is one and the next word if there isn't. This * allows multiple ^W to keep deleteing words in all cases. */ if(xpos) { /* Delete space before the deleted word */ line[ypos].text=line[ypos].text.substr(0,xpos-1) +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos-1) +line[ypos].attr.substr(xpos); xpos--; } else { /* Delete space after the word */ line[ypos].text=line[ypos].text.substr(1); line[ypos].attr=line[ypos].attr.substr(1); } draw_line(ypos,xpos); break; case '\x18': /* CTRL-X (PgDn in SyncEdit) */ break; case '\x19': /* CTRL-Y (Delete Line in SyncEdit) */ /* Delete Line */ /* ToDo: Should this kill last_xpos? */ if(line.length==1) line[0]=new Line; else line.splice(ypos,1); if(ypos>=line.length) ypos=line.length-1; if(last_xpos>=0) xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; var i; console.write("\033[M"); /* Delete Line */ /* Redraw bottom line */ draw_line(topline+lines_on_screen-1); /* Old used to redraw everything after current for(i=ypos; i<topline+lines_on_screen; i++) draw_line(i); */ break; break; case '\x1a': /* CTRL-Z (EOF) (PgUp in SyncEdit) */ var f=new File((argc==0?system.temp_dir+"INPUT.MSG":argv[0])); f.open("w"); var s=make_strings(true,true); f.write(s[0]); f.close(); return; case '\x1b': /* ESC (This should parse extra ANSI sequences) */ break; case '\x1c': /* CTRL-\ (RegExp) */ break; case '\x1d': /* CTRL-] KEY_LEFT */ last_xpos=-1; xpos--; if(xpos<0) { console.beep(); xpos=0; } break; case '\x1e': /* CTRL-^ KEY_UP */ if(last_xpos==-1) last_xpos=xpos; try_prev_line(); break; case '\x1f': /* CTRL-_ Safe quick-abort*/ return; case '\x7f': /* DELETE */ last_xpos=-1; if(xpos>=line[ypos].text.length) /* delete the hardcr, */ line[ypos].hardcr=false; line[ypos].text=line[ypos].text.substr(0,xpos) +line[ypos].text.substr(xpos+1); line[ypos].attr=line[ypos].attr.substr(0,xpos) +line[ypos].attr.substr(xpos+1); if(!rewrap()) draw_line(ypos,xpos); break; default: /* Insert the char */ add_char(key); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/3c9e8d719a0af83ed64a279663c1364cda765bf9/fseditor.js/buggy/fseditor.js
var f=new File(system.temp_dir+"INPUT.MSG"); var s=make_strings(true,true); f.write(s[0]);
function edit(){ var key; redraw_screen(); while(1) { key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A (Colour) */ key=''; draw_colour_box(); while(key=='') { key=console.getkey(K_UPPER); switch(key) { case 'K': curattr&=0xf8; break; case 'R': curattr=(curattr&0xf8)|RED; break; case 'G': curattr=(curattr&0xf8)|GREEN; break; case 'Y': curattr=(curattr&0xf8)|BROWN; break; case 'B': curattr=(curattr&0xf8)|BLUE; break; case 'M': curattr=(curattr&0xf8)|MAGENTA; break; case 'C': curattr=(curattr&0xf8)|CYAN; break; case 'W': curattr=(curattr&0xf8)|LIGHTGRAY; break; case '0': curattr=(curattr&0x8f); break; case '1': curattr=(curattr&0x8f)|(RED<<4); break; case '2': curattr=(curattr&0x8f)|(GREEN<<4); break; case '3': curattr=(curattr&0x8f)|(BROWN<<4); break; case '4': curattr=(curattr&0x8f)|(BLUE<<4); break; case '5': curattr=(curattr&0x8f)|(MAGENTA<<4); break; case '6': curattr=(curattr&0x8f)|(CYAN<<4); break; case '7': curattr=(curattr&0x8f)|(LIGHTGRAY<<4); break; case 'H': curattr|=0x08; break; case 'I': curattr|=0x80; break; case 'N': curattr=7; break; case ctrl('R'): redraw_screen(); key=''; break; case "\x1b": /* ESC */ break; default: console.beep(); key=''; break; } } status_line(); erase_colour_box(); break; case '\x02': /* KEY_HOME */ last_xpos=-1; xpos=0; set_cursor(); break; case '\x03': /* CTRL-C (Center Line) */ last_xpos=-1; line[ypos].hardcr=true; /* Trim leading/trailing whitespace */ line[ypos].text=line[ypos].text.replace(/^(\s*)(.*?)\s*$/,function (str, leading, t, offset, s) { line[ypos].attr=line[ypos].attr.substr(leading.length, t.length); xpos -= leading.length; if(xpos<0) xpos=0; return(t); }); var add=parseInt((80-line[ypos].text.length)/2); for(add=parseInt((80-line[ypos].text.length)/2); add>0; add--) { line[ypos].text=' '+line[ypos].text; line[ypos].attr=ascii(curattr)+line[ypos].attr; xpos++; } if(xpos>line[ypos].length) xpos=line[ypos].length; draw_line(ypos); set_cursor(); break; case '\x04': /* CTRL-D (Quick Find in SyncEdit)*/ break; case '\x05': /* KEY_END */ last_xpos=-1; xpos=line[ypos].text.length; set_cursor(); break; case '\x06': /* KEY_RIGHT */ last_xpos=-1; xpos++; if(xpos>line[ypos].text.length) { xpos--; console.beep(); } if(xpos>line[ypos].text.length) { if(line[ypos].hardcr) console.beep(); else { if(try_next_line()) x=0; } } set_cursor(); break; case '\x08': /* Backspace */ last_xpos=-1; if(xpos>0) { line[ypos].text=line[ypos].text.substr(0,xpos-1) +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos-1) +line[ypos].attr.substr(xpos); xpos--; } else { if(try_prev_line()) { xpos=line[ypos].text.length; line[ypos].hardcr=false; } } if(!rewrap()) draw_line(ypos,xpos); set_cursor(); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN (Insert Line in SyncEdit) */ if(last_xpos==-1) last_xpos=xpos; try_next_line(); set_cursor(); break; case '\x0b': /* CTRL-K */ break; case '\x0c': /* CTRL-L (Insert Line) */ /* ToDo: Should this kill last_xpos? */ add_new_line_below(ypos-1); xpos=0; set_cursor(); break; case '\x0d': /* CR */ last_xpos=-1; if(insert) { add_new_line_below(ypos); /* Move all this to the next line... */ line[ypos+1].text=line[ypos].text.substr(xpos); line[ypos+1].attr=line[ypos].attr.substr(xpos); line[ypos+1].hardcr=line[ypos].hardcr; line[ypos].text=line[ypos].text.substr(0,xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos); line[ypos].hardcr=true; draw_line(ypos,xpos); if(line[ypos].kludged) { line[ypos+1].kludged=true; line[ypos].kludged=false; } draw_line(ypos+1); } try_next_line(); xpos=0; rewrap(); set_cursor(); break; case '\x0e': /* CTRL-N */ break; case '\x0f': /* CTRL-O (Quick Save in SyncEdit) */ break; case '\x10': /* CTRL-P */ break; case '\x11': /* CTRL-Q (XOff) (Quick Abort in SyncEdit) */ return; case '\x12': /* CTRL-R (Quick Redraw in SyncEdit) */ redraw_screen(); break; case '\x13': /* CTRL-S (Xon) */ break; case '\x14': /* CTRL-T (Justify Line in SyncEdit) */ break; case '\x15': /* CTRL-U (Quick Quote in SyncEdit) */ break; case '\x16': /* CTRL-V (Toggle insert mode) */ insert=!insert; status_line(); break; case '\x17': /* CTRL-W (Delete Word) */ last_xpos=-1; /* Remove trailing part of word */ while(line[ypos].text.length>xpos && line[ypos].text.substr(xpos,1).search(/\s/)==-1) { line[ypos].text=line[ypos].text.substr(0,xpos) +line[ypos].text.substr(xpos+1); line[ypos].attr=line[ypos].attr.substr(0,xpos) +line[ypos].attr.substr(xpos+1); } /* Remove leading part */ while(xpos>0 && line[ypos].text.substr(xpos-1,1).search(/\s/)==-1) { line[ypos].text=line[ypos].text.substr(0,xpos-1) +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos-1) +line[ypos].attr.substr(xpos); xpos--; } /* * Remove Space... * Note that no matter what, we should delete a space. * We're either deleting the space from the end of the word if * this was the first word on the line, or the one before the * word otherwise. This puts the cursor on the previous word * if there is one and the next word if there isn't. This * allows multiple ^W to keep deleteing words in all cases. */ if(xpos) { /* Delete space before the deleted word */ line[ypos].text=line[ypos].text.substr(0,xpos-1) +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos-1) +line[ypos].attr.substr(xpos); xpos--; } else { /* Delete space after the word */ line[ypos].text=line[ypos].text.substr(1); line[ypos].attr=line[ypos].attr.substr(1); } draw_line(ypos,xpos); set_cursor(); break; case '\x18': /* CTRL-X (PgDn in SyncEdit) */ if(last_xpos==-1) last_xpos=xpos; if(ypos>=line.length-1) { console.beep(); break; } ypos+=lines_on_screen-1; if(ypos>line.length-1) ypos=line.length-1; if(ypos>=topline+lines_on_screen) topline=ypos-lines_on_screen+1; var i; for(i=edit_top; i<=edit_bottom; i++) draw_line(i-edit_top+topline); xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; set_cursor(); break; case '\x19': /* CTRL-Y (Delete Line in SyncEdit) */ /* Delete Line */ /* ToDo: Should this kill last_xpos? */ if(line.length==1) line[0]=new Line; else line.splice(ypos,1); if(ypos>=line.length) ypos=line.length-1; if(last_xpos>=0) xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; var i; for(i=ypos; i<=line.length; i++) draw_line(i); set_cursor(); break; break; case '\x1a': /* CTRL-Z (EOF) (PgUp in SyncEdit) */ if(last_xpos==-1) last_xpos=xpos; if(ypos==0) { console.beep(); break; } ypos-=lines_on_screen-1; if(ypos<0) ypos=0; if(topline>ypos) topline=ypos; var i; for(i=edit_top; i<=edit_bottom; i++) draw_line(i-edit_top+topline); xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; set_cursor(); break; case '\x1b': /* ESC (This should parse extra ANSI sequences) */ break; case '\x1c': /* CTRL-\ (RegExp) */ break; case '\x1d': /* KEY_LEFT */ last_xpos=-1; xpos--; if(xpos<0) { console.beep(); xpos=0; } set_cursor(); break; case '\x1e': /* KEY_UP */ if(last_xpos==-1) last_xpos=xpos; try_prev_line(); set_cursor(); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ last_xpos=-1; if(xpos>=line[ypos].text.length) /* delete the hardcr, */ line[ypos].hardcr=false; line[ypos].text=line[ypos].text.substr(0,xpos) +line[ypos].text.substr(xpos+1); line[ypos].attr=line[ypos].attr.substr(0,xpos) +line[ypos].attr.substr(xpos+1); if(!rewrap()) draw_line(ypos,xpos); set_cursor(); break; case '\x07': /* CTRL-G (Beep) */ /* Enter Graphic Character */ key=get_graphic(); if(key=='') break; /* Fall-Through */ default: /* Insert the char */ last_xpos=-1; /* * A whitespace at the beginning of a line following a kludge wrap * unkludges it. */ if(xpos==0 && ypos>0 && key.search(/\s/)!=-1) line[ypos-1].kludged=false; if(insert) { line[ypos].text=line[ypos].text.substr(0,xpos) +key +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos) +ascii(curattr) +line[ypos].attr.substr(xpos); } else { line[ypos].text=line[ypos].text.substr(0,xpos) +key +line[ypos].text.substr(xpos+1); line[ypos].attr=line[ypos].attr.substr(0,xpos) +key +line[ypos].attr.substr(xpos+1); } xpos++; if(!rewrap()) draw_line(ypos,xpos-1,false); set_cursor(); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/42b87f1f29a1cb4adc6444e90b90bc16b232d95d/fseditor.js/clean/fseditor.js
var f=new File(system.temp_dir+"INPUT.MSG");
var f=new File((argc==0?system.temp_dir+"INPUT.MSG":argv[0]));
function edit(quote_first){ var key; redraw_screen(); if(quote_first) { if(quote_mode()) return; } while(1) { set_cursor(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A (Colour) */ key=''; draw_colour_box(); while(key=='') { key=console.getkey(K_UPPER); switch(key) { case 'K': curattr&=0xf8; break; case 'R': curattr=(curattr&0xf8)|RED; break; case 'G': curattr=(curattr&0xf8)|GREEN; break; case 'Y': curattr=(curattr&0xf8)|BROWN; break; case 'B': curattr=(curattr&0xf8)|BLUE; break; case 'M': curattr=(curattr&0xf8)|MAGENTA; break; case 'C': curattr=(curattr&0xf8)|CYAN; break; case 'W': curattr=(curattr&0xf8)|LIGHTGRAY; break; case '0': curattr=(curattr&0x8f); break; case '1': curattr=(curattr&0x8f)|(RED<<4); break; case '2': curattr=(curattr&0x8f)|(GREEN<<4); break; case '3': curattr=(curattr&0x8f)|(BROWN<<4); break; case '4': curattr=(curattr&0x8f)|(BLUE<<4); break; case '5': curattr=(curattr&0x8f)|(MAGENTA<<4); break; case '6': curattr=(curattr&0x8f)|(CYAN<<4); break; case '7': curattr=(curattr&0x8f)|(LIGHTGRAY<<4); break; case 'H': curattr|=0x08; break; case 'I': curattr|=0x80; break; case 'N': curattr=7; break; case ctrl('R'): redraw_screen(); key=''; break; case "\x1b": /* ESC */ break; default: console.beep(); key=''; break; } } status_line(); erase_colour_box(); break; case '\x02': /* CTRL-B KEY_HOME */ last_xpos=-1; xpos=0; break; case '\x03': /* CTRL-C (Center Line) */ last_xpos=-1; line[ypos].hardcr=true; /* Trim leading/trailing whitespace */ line[ypos].text=line[ypos].text.replace(/^(\s*)(.*?)\s*$/,function (str, leading, t, offset, s) { line[ypos].attr=line[ypos].attr.substr(leading.length, t.length); xpos -= leading.length; if(xpos<0) xpos=0; return(t); }); var add=parseInt((80-line[ypos].text.length)/2); for(add=parseInt((80-line[ypos].text.length)/2); add>0; add--) { line[ypos].text=' '+line[ypos].text; line[ypos].attr=ascii(curattr)+line[ypos].attr; xpos++; } if(xpos>line[ypos].length) xpos=line[ypos].length; draw_line(ypos); break; case '\x04': /* CTRL-D (Quick Find in SyncEdit)*/ break; case '\x05': /* CTRL-E KEY_END */ last_xpos=-1; xpos=line[ypos].text.length; break; case '\x06': /* CTRL-F KEY_RIGHT */ last_xpos=-1; xpos++; if(xpos>line[ypos].text.length) { xpos--; console.beep(); } if(xpos>line[ypos].text.length) { if(line[ypos].hardcr) console.beep(); else { if(try_next_line()) x=0; } } break; case '\x07': /* CTRL-G (Beep) */ /* Enter Graphic Character */ key=get_graphic(); if(key=='') break; add_char(key); break; case '\x08': /* CTRL-H Backspace */ last_xpos=-1; if(xpos>0) { line[ypos].text=line[ypos].text.substr(0,xpos-1) +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos-1) +line[ypos].attr.substr(xpos); xpos--; } else { if(try_prev_line()) { xpos=line[ypos].text.length; line[ypos].hardcr=false; } } if(!rewrap()) draw_line(ypos,xpos); break; case '\x09': /* CTRL-I TAB... ToDo expand to spaces */ add_char(' '); while(xpos%8) add_char(' '); break; case '\x0a': /* CTRL-J KEY_DOWN (Insert Line in SyncEdit) */ if(last_xpos==-1) last_xpos=xpos; try_next_line(); break; case '\x0b': /* CTRL-K */ console.attributes=7; console.gotoxy(1,edit_top); console.cleartoeol(); console.write("\r\nEditing keys:"); console.cleartoeol(); console.write("\r\n CTRL-A - Change Colour CTRL-P - Page Down"); console.cleartoeol(); console.write("\r\n CTRL-B - Move to beginning of line CTRL-Q - Quick Abort (no save)"); console.cleartoeol(); console.write("\r\n CTRL-C - Center line on screen CTRL-R - Redraw screen"); console.cleartoeol(); console.write("\r\n CTRL-E - Move to end of line CTRL-U - Enter quote mode"); console.cleartoeol(); console.write("\r\n CTRL-F - Move right one character CTRL-V - Toggle insert mode"); console.cleartoeol(); console.write("\r\n CTRL-G - Enter graphic character CTRL-W - Delete word backwards"); console.cleartoeol(); console.write("\r\n CTRL-H - Backspace (BACKSPACE) CTRL-Y - Delete Line"); console.cleartoeol(); console.write("\r\n CTRL-I - Move to next tabstop (TAB) CTRL-Z - Save message and exit"); console.cleartoeol(); console.write("\r\n CTRL-J - Move down one line CTRL-] - Move left one character"); console.cleartoeol(); console.write("\r\n CTRL-L - Insert Line CTRL-^ - Move up one line"); console.cleartoeol(); console.write("\r\n CTRL-O - Page Up CTRL-_ - Quick Abort (no save)"); console.cleartoeol(); console.write('\r\n'); console.cleartoeol(); console.write('\r\n'); console.write("Press any key to return to editing.."); console.cleartoeol(); console.write('\r\n'); console.cleartoeol(); console.up(); console.right(37); console.getkey(); redraw_screen(); break; case '\x0c': /* CTRL-L (Insert Line) */ /* ToDo: Should this kill last_xpos? */ add_new_line_below(ypos-1); xpos=0; break; case '\x0d': /* CTRL-M CR */ last_xpos=-1; if(insert) { add_new_line_below(ypos); /* Move all this to the next line... */ line[ypos+1].text=line[ypos].text.substr(xpos); line[ypos+1].attr=line[ypos].attr.substr(xpos); line[ypos+1].hardcr=line[ypos].hardcr; line[ypos].text=line[ypos].text.substr(0,xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos); line[ypos].hardcr=true; draw_line(ypos,xpos); if(line[ypos].kludged) { line[ypos+1].kludged=true; line[ypos].kludged=false; } draw_line(ypos+1); } try_next_line(); xpos=0; rewrap(); break; case '\x0e': /* CTRL-N */ break; case '\x0f': /* CTRL-O (Quick Save/exit in SyncEdit) */ if(last_xpos==-1) last_xpos=xpos; if(ypos==0) { console.beep(); break; } ypos-=lines_on_screen-1; if(ypos<0) ypos=0; if(topline>ypos) topline=ypos; var i; for(i=edit_top; i<=edit_bottom; i++) draw_line(i-edit_top+topline); xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; break; case '\x10': /* CTRL-P */ if(last_xpos==-1) last_xpos=xpos; if(ypos>=line.length-1) { console.beep(); break; } ypos+=lines_on_screen-1; if(ypos>line.length-1) ypos=line.length-1; if(ypos>=topline+lines_on_screen) topline=ypos-lines_on_screen+1; var i; for(i=edit_top; i<=edit_bottom; i++) draw_line(i-edit_top+topline); xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; break; case '\x11': /* CTRL-Q (XOff) (Quick Abort in SyncEdit) */ return; case '\x12': /* CTRL-R (Quick Redraw in SyncEdit) */ redraw_screen(); break; case '\x13': /* CTRL-S (Xon) */ break; case '\x14': /* CTRL-T (Justify Line in SyncEdit) */ break; case '\x15': /* CTRL-U (Quick Quote in SyncEdit) */ if(quote_mode()) return; break; case '\x16': /* CTRL-V (Toggle insert mode) */ insert=!insert; status_line(); break; case '\x17': /* CTRL-W (Delete Word) */ last_xpos=-1; /* Remove trailing part of word */ while(line[ypos].text.length>xpos && line[ypos].text.substr(xpos,1).search(/\s/)==-1) { line[ypos].text=line[ypos].text.substr(0,xpos) +line[ypos].text.substr(xpos+1); line[ypos].attr=line[ypos].attr.substr(0,xpos) +line[ypos].attr.substr(xpos+1); } /* Remove leading part */ while(xpos>0 && line[ypos].text.substr(xpos-1,1).search(/\s/)==-1) { line[ypos].text=line[ypos].text.substr(0,xpos-1) +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos-1) +line[ypos].attr.substr(xpos); xpos--; } /* * Remove Space... * Note that no matter what, we should delete a space. * We're either deleting the space from the end of the word if * this was the first word on the line, or the one before the * word otherwise. This puts the cursor on the previous word * if there is one and the next word if there isn't. This * allows multiple ^W to keep deleteing words in all cases. */ if(xpos) { /* Delete space before the deleted word */ line[ypos].text=line[ypos].text.substr(0,xpos-1) +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos-1) +line[ypos].attr.substr(xpos); xpos--; } else { /* Delete space after the word */ line[ypos].text=line[ypos].text.substr(1); line[ypos].attr=line[ypos].attr.substr(1); } draw_line(ypos,xpos); break; case '\x18': /* CTRL-X (PgDn in SyncEdit) */ break; case '\x19': /* CTRL-Y (Delete Line in SyncEdit) */ /* Delete Line */ /* ToDo: Should this kill last_xpos? */ if(line.length==1) line[0]=new Line; else line.splice(ypos,1); if(ypos>=line.length) ypos=line.length-1; if(last_xpos>=0) xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; var i; console.write("\033[M"); /* Delete Line */ /* Redraw bottom line */ draw_line(topline+lines_on_screen-1); /* Old used to redraw everything after current for(i=ypos; i<topline+lines_on_screen; i++) draw_line(i); */ break; break; case '\x1a': /* CTRL-Z (EOF) (PgUp in SyncEdit) */ var f=new File(system.temp_dir+"INPUT.MSG"); f.open("w"); var s=make_strings(true,true); f.write(s[0]); f.close(); return; case '\x1b': /* ESC (This should parse extra ANSI sequences) */ break; case '\x1c': /* CTRL-\ (RegExp) */ break; case '\x1d': /* CTRL-] KEY_LEFT */ last_xpos=-1; xpos--; if(xpos<0) { console.beep(); xpos=0; } break; case '\x1e': /* CTRL-^ KEY_UP */ if(last_xpos==-1) last_xpos=xpos; try_prev_line(); break; case '\x1f': /* CTRL-_ Safe quick-abort*/ return; case '\x7f': /* DELETE */ last_xpos=-1; if(xpos>=line[ypos].text.length) /* delete the hardcr, */ line[ypos].hardcr=false; line[ypos].text=line[ypos].text.substr(0,xpos) +line[ypos].text.substr(xpos+1); line[ypos].attr=line[ypos].attr.substr(0,xpos) +line[ypos].attr.substr(xpos+1); if(!rewrap()) draw_line(ypos,xpos); break; default: /* Insert the char */ add_char(key); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/e4d95dcf74611fab5ea69e791a71a76cceaefc39/fseditor.js/buggy/fseditor.js
console.gotoxy(xpos,ypos);
set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
xpos=1; console.gotoxy(xpos,ypos);
xpos=0; set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos);
last_xpos=-1; xpos=line[ypos].text.length; set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
if(xpos>line[ypos-edit_top+topline].text.length+1) {
if(xpos>line[ypos].text.length) {
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
if(xpos>80) { xpos=1; try_next_line();
if(xpos>line[ypos].text.length) { if(line[ypos].hardcr) console.beep(); else { if(try_next_line()) x=0; }
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
console.gotoxy(xpos,ypos);
set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1);
last_xpos=-1; if(xpos>0) { line[ypos].text=line[ypos].text.substr(0,xpos-1) +line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos-1) +line[ypos].attr.substr(xpos);
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
/* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1;
if(try_prev_line()) { xpos=line[ypos].text.length; line[ypos].hardcr=false; }
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline);
if(!rewrap()) draw_line(ypos,xpos); set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
console.gotoxy(xpos,ypos);
set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
add_new_line_below(ypos-edit_top+topline);
add_new_line_below(ypos);
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1);
line[ypos+1].text=line[ypos].text.substr(xpos); line[ypos+1].attr=line[ypos].attr.substr(xpos); line[ypos+1].hardcr=line[ypos].hardcr; line[ypos].text=line[ypos].text.substr(0,xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos); line[ypos].hardcr=true; draw_line(ypos); if(line[ypos].kludged) { line[ypos+1].kludged=true; line[ypos].kludged=false; } draw_line(ypos+1);
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
xpos=1; console.gotoxy(xpos,ypos);
xpos=0; rewrap(); set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
if(insert) insert=false; else insert=true;
insert=!insert;
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
if(xpos<=0) {
if(xpos<0) {
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
xpos=1;
xpos=0;
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
console.gotoxy(xpos,ypos);
set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
console.gotoxy(xpos,ypos);
set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline);
last_xpos=-1; if(xpos>=line[ypos].text.length) /* delete the hardcr, */ line[ypos].hardcr=false; line[ypos].text=line[ypos].text.substr(0,xpos) +line[ypos].text.substr(xpos+1); line[ypos].attr=line[ypos].attr.substr(0,xpos) +line[ypos].attr.substr(xpos+1); if(!rewrap()) draw_line(ypos,xpos); set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1)
line[ypos].text=line[ypos].text.substr(0,xpos)
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
+line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ }
+line[ypos].text.substr(xpos); line[ypos].attr=line[ypos].attr.substr(0,xpos) +ascii(curattr) +line[ypos].attr.substr(xpos);
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1)
line[ypos].text=line[ypos].text.substr(0,xpos)
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
+line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr;
+line[ypos].text.substr(xpos+1); line[ypos].attr=line[ypos].attr.substr(0,xpos) +key +line[ypos].attr.substr(xpos+1);
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos);
if(!rewrap()) draw_line(ypos,xpos-1,false); set_cursor();
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { status_line(); key=console.inkey(0,10000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': /* CTRL-@ (NULL) */ case '\x01': /* CTRL-A */ break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': /* CTRL-C */ case '\x04': /* CTRL-D */ break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': /* CTRL-G (Beep) */ break; case '\x08': /* Backspace */ if(xpos>1) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-2) +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-2,1); xpos--; } else { /* ToDo: Backspace onto the previous row and re-wrap... */ if(try_prev_line()) xpos=line[ypos-edit_top+topline].text.length+1; } unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': /* CTRL-K */ case '\x0c': /* CTRL-L */ case '\x0d': /* CR */ if(insert) { add_new_line_below(ypos-edit_top+topline); /* Move all this to the next line... */ line[ypos-edit_top+topline+1].text=line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline+1].attr.splice(0,0,line[ypos-edit_top+topline].attr.slice(xpos-1,line[ypos-edit_top+topline+1].text.length)); line[ypos-edit_top+topline+1].hardcr=line[ypos-edit_top+topline].hardcr; line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,line[ypos-edit_top+topline+1].text.length); line[ypos-edit_top+topline].hardcr=true; redraw_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline+1); } try_next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': /* CTRL-N */ case '\x0f': /* CTRL-O */ case '\x10': /* CTRL-P */ case '\x11': /* CTRL-Q (XOff) */ return; case '\x12': /* CTRL-R */ case '\x13': /* CTRL-S (Xon) */ case '\x14': /* CTRL-T */ case '\x15': /* CTRL-U */ case '\x16': /* CTRL-V */ if(insert) insert=false; else insert=true; break; case '\x17': /* CTRL-W */ case '\x18': /* CTRL-X */ case '\x19': /* CTRL-Y */ case '\x1a': /* CTRL-Z (EOF) */ case '\x1b': /* ESC */ case '\x1c': /* CTRL-\ */ break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': /* CTRL-_ */ break; case '\x7f': /* DELETE */ line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr.splice(xpos-1,1); unwrap_line(ypos-edit_top+topline); redraw_line(ypos-edit_top+topline); break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(xpos-1,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); line[ypos-edit_top+topline].attr[xpos-1]=curattr; } xpos++; if(xpos>80) { /* Wrap */ xpos=1; xpos=wrap_line(ypos-edit_top+topline); next_line(); } else { if(line[ypos-edit_top+topline].text.length > 79) wrap_line(ypos-edit_top+topline); } redraw_line(ypos-edit_top+topline); console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js
console.gotoxy(1,ypos);
function edit(){ var key; console.gotoxy(xpos,ypos); while(1) { key=console.inkey(1000); if(key=='') continue; switch(key) { /* We're getting all the CTRL keys here... */ case '\x00': case '\x01': break; case '\x02': /* KEY_HOME */ xpos=1; console.gotoxy(xpos,ypos); break; case '\x03': case '\x04': break; case '\x05': /* KEY_END */ xpos=line[ypos-edit_top+topline].text.length+1; if(xpos>80) xpos=80; console.gotoxy(xpos,ypos); break; case '\x06': /* KEY_RIGHT */ xpos++; if(xpos>line[ypos-edit_top+topline].text.length+1) { xpos--; console.beep(); } if(xpos>80) { xpos=1; try_next_line(); } console.gotoxy(xpos,ypos); break; case '\x07': break; case '\x08': /* Backspace */ /* ToDo: Backspace onto the previous row and re-wrap... */ if(xpos==0) { } case '\x09': /* TAB... ToDo expand to spaces */ break; case '\x0a': /* KEY_DOWN */ try_next_line(); console.gotoxy(xpos,ypos); break; case '\x0b': case '\x0c': case '\x0d': /* CR */ /* ToDo: Break current line at current pos... */ if(insert) add_new_line_below(); next_line(); xpos=1; console.gotoxy(xpos,ypos); break; case '\x0e': case '\x0f': case '\x10': case '\x11': /* CTRL-Q */ return; case '\x12': case '\x13': case '\x14': case '\x15': case '\x16': case '\x17': case '\x18': case '\x19': case '\x1a': case '\x1b': case '\x1c': break; case '\x1d': /* KEY_LEFT */ xpos--; if(xpos<=0) { console.beep(); xpos=1; } console.gotoxy(xpos,ypos); break; case '\x1e': /* KEY_UP */ try_prev_line(); console.gotoxy(xpos,ypos); break; case '\x1f': break; case '\xf7': /* DELETE */ break; default: /* Insert the char */ if(insert) { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos-1); line[ypos-edit_top+topline].attr.splice(ypos,0,curattr); if(line[ypos-edit_top+topline].text.length > 80) { /* ToDo: Wrap */ } } else { line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1) +key +line[ypos-edit_top+topline].text.substr(xpos); } console.gotoxy(1,ypos); line[ypos-edit_top+topline].draw(ypos); console.gotoxy(xpos,ypos); xpos++; if(xpos>80) { xpos=1; if(insert) add_new_line_below(); next_line(); break; } console.gotoxy(xpos,ypos); } }}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/9572834cb6b42d6112d5c122ea055f91962312e7/fseditor.js/clean/fseditor.js
var dstUri = flowHelper.getDocumentHelper(cocoon).getSourceUri(flowHelper.getPageEnvelope(cocoon).getDocument());
var dstUri = flowHelper.getPageEnvelope(cocoon).getDocument().getSourceURI();
function editDocument() { try { var flowHelper = new FlowHelper(); var resolver = cocoon.getComponent(SourceResolver.ROLE); var dstUri = flowHelper.getDocumentHelper(cocoon).getSourceUri(flowHelper.getPageEnvelope(cocoon).getDocument()); SourceUtil.copy(resolver, cocoon.parameters["sourceUri"], dstUri, _getParameter("useBuffer", "false") == "true"); if(_getParameter("noCheckin", "false") == "false") flowHelper.reservedCheckIn(cocoon, _getParameter("backup", "true") == "true"); if(_getParameter("noWorkflow", "false") == "false") flowHelper.triggerWorkflow(cocoon, _getParameter("workflowEvent", "edit")); if(_getParameter("noStatus", "false") == "false") cocoon.sendStatus(_getParameter("status", 204)); else cocoon.redirectTo(_getParameter("redirectUrl", "FIXME")); } catch (exception) { cocoon.log.error("Can not edit doucment.", exception); } finally { if(resolver != null) cocoon.releaseComponent(resolver); }}
791 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/791/d9c0c0cac60da63773f84a1c79143533b1c4b322/edit-document.js/clean/src/webapp/lenya/usecases/edit-document.js
cocoon.log.error("Can not edit doucment.", exception);
cocoon.log.error("Can not edit doucment.", exception.toString());
function editDocument() { try { var flowHelper = new FlowHelper(); var resolver = cocoon.getComponent(SourceResolver.ROLE); var dstUri = flowHelper.getDocumentHelper(cocoon).getSourceUri(flowHelper.getPageEnvelope(cocoon).getDocument()); SourceUtil.copy(resolver, cocoon.parameters["sourceUri"], dstUri, _getParameter("useBuffer", "false") == "true"); if(_getParameter("noCheckin", "false") == "false") flowHelper.reservedCheckIn(cocoon, _getParameter("backup", "true") == "true"); if(_getParameter("noWorkflow", "false") == "false") flowHelper.triggerWorkflow(cocoon, _getParameter("workflowEvent", "edit")); if(_getParameter("noStatus", "false") == "false") cocoon.sendStatus(_getParameter("status", 204)); else cocoon.redirectTo(_getParameter("redirectUrl", "FIXME")); } catch (exception) { cocoon.log.error("Can not edit doucment.", exception); } finally { if(resolver != null) cocoon.releaseComponent(resolver); }}
791 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/791/d9c0c0cac60da63773f84a1c79143533b1c4b322/edit-document.js/clean/src/webapp/lenya/usecases/edit-document.js
if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("edit-document.js::editDocument() after usecase.execute(), hasErrors ? " + usecase.hasErrors()); }
function editDocument() { var usecaseName = cocoon.parameters["lenya.usecase"]; var usecaseResolver; var usecase; try { usecaseResolver = cocoon.getComponent("org.apache.lenya.cms.usecase.UsecaseResolver"); usecase = usecaseResolver.resolve(usecaseName); var flowHelper = cocoon.getComponent("org.apache.lenya.cms.cocoon.flow.FlowHelper"); var request = flowHelper.getRequest(cocoon); var sourceUrl = Packages.org.apache.lenya.util.ServletHelper.getWebappURI(request); usecase.setSourceURL(sourceUrl); usecase.setName(usecaseName); usecase.checkPreconditions(); usecase.lockInvolvedObjects(); usecase.execute(); // FIXME: handle error messages //if (usecase.hasErrors()) { //} if(_getParameter("noStatus", "false") == "false") cocoon.sendStatus(_getParameter("status", 204)); else cocoon.redirectTo(_getParameter("redirectUrl", "FIXME")); } catch (exception) { /* FIXME: This is unclean because the flow will not return a value if there is an exception */ cocoon.log.error("Can not edit document.", exception); } finally { /* done with usecase component, tell usecaseResolver to release it */ if (usecaseResolver != null) { if (usecase != null) { usecaseResolver.release(usecase); usecase = undefined; } cocoon.releaseComponent(usecaseResolver); } } }
791 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/791/30dca72bde1938ec256d999c97b05567424874a7/edit-document.js/buggy/src/webapp/lenya/usecases/edit-document.js
cocoon.log.error("Can not edit doucment.", exception.toString());
cocoon.log.error("Can not edit document.", exception.toString());
function editDocument() { try { var flowHelper = new FlowHelper(); var resolver = cocoon.getComponent(SourceResolver.ROLE); var dstUri = flowHelper.getPageEnvelope(cocoon).getDocument().getSourceURI(); SourceUtil.copy(resolver, cocoon.parameters["sourceUri"], dstUri, _getParameter("useBuffer", "false") == "true"); if(_getParameter("noCheckin", "false") == "false") flowHelper.reservedCheckIn(cocoon, _getParameter("backup", "true") == "true"); if(_getParameter("noWorkflow", "false") == "false") flowHelper.triggerWorkflow(cocoon, _getParameter("workflowEvent", "edit")); if(_getParameter("noStatus", "false") == "false") cocoon.sendStatus(_getParameter("status", 204)); else cocoon.redirectTo(_getParameter("redirectUrl", "FIXME")); } catch (exception) { cocoon.log.error("Can not edit doucment.", exception.toString()); } finally { if(resolver != null) cocoon.releaseComponent(resolver); }}
791 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/791/22f91cf430d8916bb8751222da90d0322671b94d/edit-document.js/buggy/src/webapp/lenya/usecases/edit-document.js
if (usecase.getErrorMessages().isEmpty()) {
if (!usecase.getErrorMessages().isEmpty()) { throw new Exception("Saving failed!");
function editDocument() { var usecaseName = cocoon.parameters["lenya.usecase"]; var usecaseResolver; var usecase; try { usecaseResolver = cocoon.getComponent("org.apache.lenya.cms.usecase.UsecaseResolver"); usecase = usecaseResolver.resolve(usecaseName); var flowHelper = cocoon.getComponent("org.apache.lenya.cms.cocoon.flow.FlowHelper"); var request = flowHelper.getRequest(cocoon); var sourceUrl = Packages.org.apache.lenya.util.ServletHelper.getWebappURI(request); if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("edit-document.js::editDocument() calling usecase methods, usecaseName [" + usecaseName + "], sourceUrl [" + sourceUrl + "]"); } usecase.setSourceURL(sourceUrl); usecase.setName(usecaseName); usecase.checkPreconditions(); usecase.lockInvolvedObjects(); if (!usecase.getErrorMessages().isEmpty()) { throw new Exception("Checking pre-conditions or locking failed!"); } else { usecase.execute(); if (usecase.getErrorMessages().isEmpty()) { // TODO: handle error messages } } if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("edit-document.js::editDocument() after usecase.execute(), hasErrors ? " + usecase.hasErrors()); } // FIXME: handle error messages //if (usecase.hasErrors()) { //} if(_getParameter("noStatus", "false") == "false") cocoon.sendStatus(_getParameter("status", 204)); else cocoon.redirectTo(_getParameter("redirectUrl", "FIXME")); } catch (exception) { /* FIXME: This is unclean because the flow will not return a value if there is an exception */ cocoon.log.error("Can not edit document.", exception); } finally { /* done with usecase component, tell usecaseResolver to release it */ if (usecaseResolver != null) { if (usecase != null) { usecaseResolver.release(usecase); usecase = undefined; } cocoon.releaseComponent(usecaseResolver); } } }
791 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/791/07182990299d8db12ddc519a234d0a73ac2f1dde/edit-document.js/buggy/src/webapp/lenya/usecases/edit-document.js
usecaseResolver = cocoon.getComponent("org.apache.lenya.cms.usecase.UsecaseResolver"); usecase = usecaseResolver.resolve(usecaseName);
function editDocument() { var usecaseName = cocoon.parameters["lenya.usecase"]; var usecaseResolver; var usecase; try { usecaseResolver = cocoon.getComponent("org.apache.lenya.cms.usecase.UsecaseResolver"); usecase = usecaseResolver.resolve(usecaseName); var flowHelper = cocoon.getComponent("org.apache.lenya.cms.cocoon.flow.FlowHelper"); var request = flowHelper.getRequest(cocoon); var sourceUrl = Packages.org.apache.lenya.util.ServletHelper.getWebappURI(request); if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("edit-document.js::editDocument() calling usecase methods, usecaseName [" + usecaseName + "], sourceUrl [" + sourceUrl + "]"); } usecase.setSourceURL(sourceUrl); usecase.setName(usecaseName); usecase.checkPreconditions(); usecase.lockInvolvedObjects(); if (!usecase.getErrorMessages().isEmpty()) { throw new Exception("Checking pre-conditions or locking failed!"); } else { usecase.execute(); if (!usecase.getErrorMessages().isEmpty()) { throw new Exception("Saving failed!"); } } if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("edit-document.js::editDocument() after usecase.execute(), hasErrors ? " + usecase.hasErrors()); } // FIXME: handle error messages //if (usecase.hasErrors()) { //} if(_getParameter("noStatus", "false") == "false") cocoon.sendStatus(_getParameter("status", 204)); else cocoon.redirectTo(_getParameter("redirectUrl", "FIXME")); } catch (exception) { /* FIXME: This is unclean because the flow will not return a value if there is an exception */ cocoon.log.error("Can not edit document.", exception); } finally { /* done with usecase component, tell usecaseResolver to release it */ if (usecaseResolver != null) { if (usecase != null) { usecaseResolver.release(usecase); usecase = undefined; } cocoon.releaseComponent(usecaseResolver); } } }
791 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/791/cdb054bf422e1b28f7f858ec35a4d01ce6a311d0/edit-document.js/buggy/src/webapp/lenya/usecases/edit-document.js
usecaseResolver = cocoon.getComponent("org.apache.lenya.cms.usecase.UsecaseResolver"); usecase = usecaseResolver.resolve(sourceUrl, usecaseName);
function editDocument() { var usecaseName = cocoon.parameters["lenya.usecase"]; var usecaseResolver; var usecase; try { usecaseResolver = cocoon.getComponent("org.apache.lenya.cms.usecase.UsecaseResolver"); usecase = usecaseResolver.resolve(usecaseName); var flowHelper = cocoon.getComponent("org.apache.lenya.cms.cocoon.flow.FlowHelper"); var request = flowHelper.getRequest(cocoon); var sourceUrl = Packages.org.apache.lenya.util.ServletHelper.getWebappURI(request); if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("edit-document.js::editDocument() calling usecase methods, usecaseName [" + usecaseName + "], sourceUrl [" + sourceUrl + "]"); } usecase.setSourceURL(sourceUrl); usecase.setName(usecaseName); usecase.checkPreconditions(); usecase.lockInvolvedObjects(); if (!usecase.getErrorMessages().isEmpty()) { throw new Exception("Checking pre-conditions or locking failed!"); } else { usecase.execute(); if (!usecase.getErrorMessages().isEmpty()) { throw new Exception("Saving failed!"); } } if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("edit-document.js::editDocument() after usecase.execute(), hasErrors ? " + usecase.hasErrors()); } // FIXME: handle error messages //if (usecase.hasErrors()) { //} if(_getParameter("noStatus", "false") == "false") cocoon.sendStatus(_getParameter("status", 204)); else cocoon.redirectTo(_getParameter("redirectUrl", "FIXME")); } catch (exception) { /* FIXME: This is unclean because the flow will not return a value if there is an exception */ cocoon.log.error("Can not edit document.", exception); } finally { /* done with usecase component, tell usecaseResolver to release it */ if (usecaseResolver != null) { if (usecase != null) { usecaseResolver.release(usecase); usecase = undefined; } cocoon.releaseComponent(usecaseResolver); } } }
791 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/791/cdb054bf422e1b28f7f858ec35a4d01ce6a311d0/edit-document.js/buggy/src/webapp/lenya/usecases/edit-document.js
this.setTestCase(new TestCase());
this.setTestCase(new TestCase(), true);
function Editor(window, isSidebar) { this.log.debug("initializing"); this.window = window; window.editor = this; var self = this; this.isSidebar = isSidebar; this.recordFrameTitle = false; this.document = document; this.recordingEnabled = true; this.setOptions(optionsManager.load()); this.loadExtensions(); this.loadSeleniumAPI(); this.selectDefaultReference(); this.treeView = new TreeView(this, document, document.getElementById("commands")); this.sourceView = new SourceView(this, document.getElementById("source")); this.testCaseListeners = new Array(); this.testCaseListeners.push(function(testCase) { if (self.view) { self.view.testCase = testCase; } testCase.observer = { modifiedStateUpdated: function() { self.updateTitle(); } }; }); this.setTestCase(new TestCase()); this.initOptions(); //this.toggleView(this.treeView); // "debugger" cannot be used since it is a reserved word in JS this.selDebugger = new Debugger(this); //top.document.commandDispatcher.getControllers().appendController(Editor.controller); //window.controllers.appendController(Editor.controller); top.controllers.appendController(Editor.controller); //window.controllers.appendController(controller); this.updateViewTabs(); this.infoPanel = new Editor.InfoPanel(this); //top.document.commandDispatcher.updateCommands("selenium-ide-state"); document.addEventListener("focus", Editor.checkTimestamp, false); this.log.info("initialized"); setTimeout("editor.showLoadErrors()", 500); if (isSidebar) { Recorder.registerForWindow(window.parent, this); } else { Recorder.registerAll(this); }}
4983 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4983/593d8b5a6ee9a382e8159e89ccba637185daef8a/editor.js/clean/src/content/editor.js
NewWindow('showEditTimerEventWindow?'+xy, 'editTimer', '780', '370', 'no');
NewWindow('showEditTimerEventWindow?'+xy, 'editTimer', '780', '400', 'no');
function editTimerEvent(xy){ NewWindow('showEditTimerEventWindow?'+xy, 'editTimer', '780', '370', 'no');}
6281 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6281/abb1e272e865f5741f2f4e1557aa656637eed711/timer.js/buggy/tuxbox/enigma/data/htdocs/timer.js
NewWindow('/editTimerEvent?'+xy, 'editTimer', '780', '300', 'no');
NewWindow('/editTimerEvent?'+xy, 'editTimer', '780', '350', 'no');
function editTimerEvent(xy){ NewWindow('/editTimerEvent?'+xy, 'editTimer', '780', '300', 'no');}
6281 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6281/d56b6e9f8585813a802ddd46e92b88c2fb02dd9e/timer.js/clean/tuxbox/enigma/data/htdocs/timer.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
107 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/107/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
2069 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2069/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
5523 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5523/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
167 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/167/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
949 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/949/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
269 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/269/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
2338 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2338/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
5521 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5521/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
1604 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1604/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
6649 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6649/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
4687 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4687/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
return event.srcElement || event.currentTarget;
return event.target || event.srcElement;
element: function(event) { return event.srcElement || event.currentTarget; },
1534 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1534/481cac9658848a32838a5a3899610f52844ba2f0/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
element.style[name] = style[name];
var value = style[name]; if (value == null) value = ""; element.style[name] = value;
function elementSetStyle(element, style) { for (var name in style) { element.style[name] = style[name]; }}
4983 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4983/b65b96860c14f050944e3fa047dbc1565d3db0a5/htmlutils.js/clean/code/javascript/core/scripts/htmlutils.js
for (i = 0; i < node.attributes.length; i++) { var att = node.attributes[i]; if (att.name == 'name' || att.name == 'value' || att.name == 'id' || att.name == 'style' || att.name == 'action' || att.name == 'onclick' || att.name == 'href') { conditions['@' + att.name] = att.value;
if (node.attributes) { for (i = 0; i < node.attributes.length; i++) { var att = node.attributes[i]; if (att.name == 'name' || att.name == 'value' || att.name == 'id' || att.name == 'style' || att.name == 'action' || att.name == 'onclick' || att.name == 'href') { conditions['@' + att.name] = att.value; }
function elementXPath(node, conditions) { var i; for (i = 0; i < node.attributes.length; i++) { var att = node.attributes[i]; if (att.name == 'name' || att.name == 'value' || att.name == 'id' || att.name == 'style' || att.name == 'action' || att.name == 'onclick' || att.name == 'href') { conditions['@' + att.name] = att.value; } } return node.nodeName.toLowerCase() + encodeConditions(conditions); }
4983 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4983/987072c9677dabfd007fab08d4c76099ebb26d9e/recorder-events.js/buggy/content/recorder-events.js
i=finduser(str);
i=bbs.finduser(str);
function email(){ var key; var i; while(1) { if(!(user.settings & USER_EXPERT)) bbs.menu("e-mail"); // async console.putmsg("\r\nyhE-mail: n"); key=get_next_keys("?SRFNUKQ\r"); bbs.log_key(key); switch(key) { case '?': if(user.settings & USER_EXPERT) bbs.menu("e-mail"); break; case 'S': console.putmsg("_\r\nbhE-mail (User name or number): w"); str=get_next_str("",40,K_UPRLWR,false); if(str==null || str=="") break; if(str=="Sysop") str="1"; if(str.search(/\@/)!=-1) bbs.netmail(str); else { i=finduser(str); if(i>0) bbs.email(i,WM_EMAIL); } break; case 'U': console.putmsg("_\r\nbhE-mail (User name or number): w"); str=get_next_str("",40,K_UPRLWR,false); if(str==null || str=="") break; if(str=="Sysop") str="1"; if(str.search(/\@/)!=-1) bbs.netmail(str,WM_FILE); else { i=finduser(str); if(i>0) bbs.email(i,WM_EMAIL|WM_FILE); } break; case 'R': bbs.read_mail(MAIL_YOUR); break; case 'F': bbs.email(1,WM_EMAIL,bbs.text(ReFeedback)); break; case 'N': if(console.noyes("\r\nAttach a file")) i=WM_FILE; else i=0; console.putmsg(bbs.text(EnterNetMailAddress),P_SAVEATR); str=get_next_str("",60,K_LINE,false); if(str!=null && str !="") bbs.netmail(str,i); break; case 'K': bbs.read_mail(MAIL_SENT); break; case 'Q': default: return; } } return}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/bb216196faa864ac714615a9a16ab2fa9f3ff6a6/classic_shell.js/buggy/classic_shell.js
i=finduser(str);
i=bbs.finduser(str);
function email(){ var key; var i; while(1) { if(!(user.settings & USER_EXPERT)) bbs.menu("e-mail"); // async console.putmsg("\r\nyhE-mail: n"); key=get_next_keys("?SRFNUKQ\r"); bbs.log_key(key); switch(key) { case '?': if(user.settings & USER_EXPERT) bbs.menu("e-mail"); break; case 'S': console.putmsg("_\r\nbhE-mail (User name or number): w"); str=get_next_str("",40,K_UPRLWR,false); if(str==null || str=="") break; if(str=="Sysop") str="1"; if(str.search(/\@/)!=-1) bbs.netmail(str); else { i=finduser(str); if(i>0) bbs.email(i,WM_EMAIL); } break; case 'U': console.putmsg("_\r\nbhE-mail (User name or number): w"); str=get_next_str("",40,K_UPRLWR,false); if(str==null || str=="") break; if(str=="Sysop") str="1"; if(str.search(/\@/)!=-1) bbs.netmail(str,WM_FILE); else { i=finduser(str); if(i>0) bbs.email(i,WM_EMAIL|WM_FILE); } break; case 'R': bbs.read_mail(MAIL_YOUR); break; case 'F': bbs.email(1,WM_EMAIL,bbs.text(ReFeedback)); break; case 'N': if(console.noyes("\r\nAttach a file")) i=WM_FILE; else i=0; console.putmsg(bbs.text(EnterNetMailAddress),P_SAVEATR); str=get_next_str("",60,K_LINE,false); if(str!=null && str !="") bbs.netmail(str,i); break; case 'K': bbs.read_mail(MAIL_SENT); break; case 'Q': default: return; } } return}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/bb216196faa864ac714615a9a16ab2fa9f3ff6a6/classic_shell.js/buggy/classic_shell.js
this.hotkeys=KEY_LEFT+KEY_RIGHT+"\b\x7f\x1b";
this.hotkeys=KEY_LEFT+KEY_RIGHT+"\b\x7f\x1b"+ctrl('O')+ctrl('U')+ctrl('T')+ctrl('K')+ctrl('P');
function Emailmenu(){ var width=24; this.items=new Array(); this.xpos=17; this.ypos=2; this.lpadding="\xb3"; this.rpadding="\xb3"; this.hotkeys=KEY_LEFT+KEY_RIGHT+"\b\x7f\x1b"; this.add(top_bar(width),undefined,undefined,"",""); this.add(format_opt("|Send Mail",width,true),"S",width); this.add("|Read Inbox","R",width); this.add("Read Sent |Messages","M",width,undefined,undefined,user.compare_ars("REST K")); this.add(bottom_bar(width),undefined,undefined,"",""); this.timeout=100; this.callback=message_callback;}
4284 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/34f6c69cd3ce42ea1878ef314f794dabc773eb90/lbshell.js/clean/lbshell.js
if (!MODULES.Exists(mod_name)) {
if (MODULES.Exists(mod_name)) { item = MODULES.Item(mod_name); MODULES.Remove(mod_name); if (item.deps.length) { output += emit_dep_modules(item.deps); }
function emit_dep_modules(module_names){ var i, mod_name, j; var output = ""; for (i in module_names) { mod_name = module_names[i]; if (!MODULES.Exists(mod_name)) { output += emit_module(item); continue; } item = MODULES.Item(mod_name); output += emit_dep_modules(item.deps); } return output;}
631 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/631/510dd7cca578e097a3ba7f615a19820c1337d29a/buildconf.js/buggy/win32/build/buildconf.js
continue;
function emit_dep_modules(module_names){ var i, mod_name, j; var output = ""; for (i in module_names) { mod_name = module_names[i]; if (!MODULES.Exists(mod_name)) { output += emit_module(item); continue; } item = MODULES.Item(mod_name); output += emit_dep_modules(item.deps); } return output;}
631 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/631/510dd7cca578e097a3ba7f615a19820c1337d29a/buildconf.js/buggy/win32/build/buildconf.js
item = MODULES.Item(mod_name); output += emit_dep_modules(item.deps);
function emit_dep_modules(module_names){ var i, mod_name, j; var output = ""; for (i in module_names) { mod_name = module_names[i]; if (!MODULES.Exists(mod_name)) { output += emit_module(item); continue; } item = MODULES.Item(mod_name); output += emit_dep_modules(item.deps); } return output;}
631 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/631/510dd7cca578e097a3ba7f615a19820c1337d29a/buildconf.js/buggy/win32/build/buildconf.js
emptyFunction: function() {}
emptyFunction: function() {},
emptyFunction: function() {}
742 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/742/3f913f897829fb026ef98df2d57f8da94ee5339d/prototype.js/buggy/public/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
2338 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2338/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/clean/railties/html/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
1534 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1534/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
269 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/269/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/buggy/railties/html/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
2069 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2069/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
1534 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1534/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/clean/railties/html/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
1604 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1604/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
4687 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4687/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/buggy/railties/html/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
5523 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5523/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/clean/railties/html/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
5521 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5521/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/buggy/actionpack/lib/action_view/helpers/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
949 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/949/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/buggy/railties/html/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
167 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/167/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/clean/actionpack/lib/action_view/helpers/javascripts/prototype.js
element.disabled = 'true';
element.disabled = false;
enable: function(element) { element = $(element); element.blur(); element.disabled = 'true'; return element; }
6649 /local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6649/55c6c64da0fbbfba74a0b4ad68022bf640a0a049/prototype.js/buggy/railties/html/javascripts/prototype.js