Krolyxon
Commit 9632dd8

Branches

Refs →

nsxiv9632dd8

Fixup for 9574150

Author
Bert Münnich
Date
2014-01-08 21:14 +0100
Parent
9574150
Commit
9632dd88b97c0051ba43c82a3eb26bc2694489a0

+6 −4

1 file changed

  1. M main.c +6 −4
M main.c View
@@ -459,7 +459,7 @@ void key_handler(const char *key, unsigned int mask)
459459 pid_t pid;
460460 int retval, status, n = mode == MODE_IMAGE ? fileidx : tns.sel;
461461 char *cmd = exec[EXEC_KEY].cmd, kstr[32];
462− struct stat oldstat, newstat;
462+ struct stat oldst, newst;
463463
464464 if (cmd == NULL || key == NULL)
465465 return;
@@ -469,7 +469,7 @@ void key_handler(const char *key, unsigned int mask)
469469 mask & Mod1Mask ? "M-" : "",
470470 mask & ShiftMask ? "S-" : "", key);
471471
472− stat(files[n].path, &oldstat);
472+ stat(files[n].path, &oldst);
473473
474474 if ((pid = fork()) == 0) {
475475 execl(cmd, cmd, kstr, files[n].path, NULL);
@@ -486,10 +486,12 @@ void key_handler(const char *key, unsigned int mask)
486486 if (WIFEXITED(status) == 0 || retval != 0)
487487 warn("key handler exited with non-zero return value: %d", retval);
488488
489− if (stat(files[n].path, &newstat) == 0 &&
490− memcmp(&oldstat, &newstat, sizeof(oldstat)) == 0)
489+ if (stat(files[n].path, &newst) == 0 &&
490+ memcmp(&oldst.st_mtime, &newst.st_mtime, sizeof(oldst.st_mtime)) == 0)
491491 {
492492 /* file has not changed */
493+ win_set_cursor(&win, CURSOR_ARROW);
494+ set_timeout(reset_cursor, TO_CURSOR_HIDE, true);
493495 return;
494496 }
495497 if (mode == MODE_IMAGE) {