~ruther/CTU-FEE-B0B35APO-Semestral-project

7fe42ecb3634636148211ca16808a24fd13baa05 — František Boháček 3 years ago 6b4543b
fix: file opening throw error if nothing opened
1 files changed, 5 insertions(+), 3 deletions(-)

M file-browser/src/file_open.c
M file-browser/src/file_open.c => file-browser/src/file_open.c +5 -3
@@ 78,7 78,7 @@ static bool file_open_text(file_t *file, exec_options_t *options,
static bool file_open_executable(file_t *file, exec_options_t *options,
                                 fileaccess_state_t state,
                                 file_operation_error_t *error) {
  if (file->permissions & S_IXUSR) {
  if (file->permissions & S_IEXEC) {
    // executable
    file_prepare_before_open();
    executing_file_or_error_t executing_or_error =


@@ 115,8 115,10 @@ file_operation_error_t file_open(file_t *file, exec_options_t *options, fileacce
    return error;
  }
  // 3. text mime
  file_open_text(file, options, state, &error);
  if (!file_open_text(file, options, state, &error)) {
    return FILOPER_UNKNOWN;
  }

  // TODO: figure out return data?
  // TODO: figure out return return?
  return error;
}

Do not follow this link