чување 75fd506b13629e7c87156b9db41ad0d891b750f4
родитељ 137a5bc48e28f2d2877a34b833e42d2260f8c9c7
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Mon, 21 Feb 2022 15:11:30 +0100
Small fixes
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 1, додавања: 3(+), брисања: 4(-)
diff --git a/sled.c b/sled.c
@@ -53,6 +53,7 @@ void reread_callback(struct DrawState* state, struct tb_event* ev);
void quit_callback(struct DrawState* state, struct tb_event* ev);
struct BufferLine* load_info(struct DrawState* state);
struct DrawState* load_msgstr(struct DrawState* state);
+int create_file(struct DrawState* dstate, long* lineno, long* col);
int load_file(struct DrawState* dstate, long* lineno, long* col);
int save_file(struct DrawState* state);
struct DrawState* join_lines(struct DrawState* state, size_t first_line,
@@ -1645,8 +1646,7 @@ main(int argc, char** argv)
init_drawstate(&state, error, action, filename, prompt);
- result = stat(filename, &st);
- if (result == -1)
+ if (stat(filename, &st) == -1)
{
char dirname[MAXPATH];
char* slash = NULL;
@@ -1663,8 +1663,7 @@ main(int argc, char** argv)
*(dirname + 1) = 0;
}
- result = access(dirname, F_OK | R_OK | W_OK);
- if (result == -1)
+ if (access(dirname, F_OK | R_OK | W_OK) == -1)
goto file_error;
result = create_file(&state);