I've never debugged Slick-C code before, so I am not sure exactly what I should be looking for. But I did find something that might be strange as I single-stepped through the save function. When it got to the following code it entered the "if (_QReadOnly())" block, but it did not bring up a prompt (which is what I assume _prompt_readonly_file should do):
// this won't work too good if we are in read-only mode
if (_QReadOnly()) {
status = _prompt_readonly_file(true);
if (status == COMMAND_CANCELLED_RC) {
return (status);
} else if (status == -1) {
continue;
}
//status = _readonly_error(0, true);
if (!_QReadOnly()) status=0;
}
I stepped into the _prompt_readonly_file function and the "if (!(prompt_readonly_flags & PROMPT_READONLY_NOPROMPT))" test failed. It did pass the "if (result == 'flags')" check and executed the " _set_read_only(false, false, true, false);" call:
if (!(prompt_readonly_flags & PROMPT_READONLY_NOPROMPT)) {
result = show('-reinit -modal -nocenter _prompt_readonly', p_window_id, multifile);
if (result == '') {
return COMMAND_CANCELLED_RC;
}
}
if (result == 'flags') {
if (prompt_readonly_flags & PROMPT_READONLY_MAKE_WRITABLE) {
_set_read_only(false, false, true, false);
status = 0; // flip readonly file attrs, return ok status
} else if (prompt_readonly_flags & PROMPT_READONLY_EDIT_IN_MEMORY) {
status = 0; // edit anyway, return ok status
} else if (prompt_readonly_flags & PROMPT_READONLY_CHECKOUT) {
status = vccheckout(p_buf_name, multifile, false);
} else {
status = -1; // skip processing
}
} else if (result == 'saveas') {
status = gui_save_as();
}
Note sure if any of that info is useful.