I changed mode_insert in conio.c to 1 so that the default mode would be insert, and since then the console just doesn't seem to work right, at least for the first command you enter. Eg if I type:
restore pool=aurora-disk Bacula would tell me something like "restorepool: is an invalid command.". You can get the same effect by building with conio (the default), pressing the insert key, then typing a command. I added some debugging to conio.c and it seems that cl is being decremented somewhere, I think in forward() which is called by insert_space(). If I initialise curline in Putting a '\0' character at position 0 of curline is sufficient to fix the problem for me, but I'm not sure that it's completely the correct solution. The other problem I have seen is where I type a command and then backspace over it. To reproduce this problem: 1. start up bconsole 2. type 'status' 3. hit backspace 6 times 4. press enter Bacula will respond with "Status available for: etc", indicating that it received an 's'. Debugging shows this to be true - when you backspace, cp gets reduced to 0 but cl doesn't. Under some circumstances, repeating steps 1-3 above result in a buffer overflow or something but I can't reproduce that reliably. I guess it depends somewhat on what is in the uninitialised buffers when bconsole starts. According to the source code, conio is preferred over readline. Is this still the case? It's probably going to be a few off-by-one errors in conio.c... has anyone looked into this before? Thanks James ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Bacula-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bacula-devel
