nsxiv9632dd8
Fixup for 9574150
+6 −4
1 file changed
- M main.c +6 −4
| @@ -459,7 +459,7 @@ void key_handler(const char *key, unsigned int mask) | |||
| 459 | 459 | pid_t pid; | |
| 460 | 460 | int retval, status, n = mode == MODE_IMAGE ? fileidx : tns.sel; | |
| 461 | 461 | char *cmd = exec[EXEC_KEY].cmd, kstr[32]; | |
| 462 | − | struct stat oldstat, newstat; | |
| 462 | + | struct stat oldst, newst; | |
| 463 | 463 | ||
| 464 | 464 | if (cmd == NULL || key == NULL) | |
| 465 | 465 | return; | |
| @@ -469,7 +469,7 @@ void key_handler(const char *key, unsigned int mask) | |||
| 469 | 469 | mask & Mod1Mask ? "M-" : "", | |
| 470 | 470 | mask & ShiftMask ? "S-" : "", key); | |
| 471 | 471 | ||
| 472 | − | stat(files[n].path, &oldstat); | |
| 472 | + | stat(files[n].path, &oldst); | |
| 473 | 473 | ||
| 474 | 474 | if ((pid = fork()) == 0) { | |
| 475 | 475 | execl(cmd, cmd, kstr, files[n].path, NULL); | |
| @@ -486,10 +486,12 @@ void key_handler(const char *key, unsigned int mask) | |||
| 486 | 486 | if (WIFEXITED(status) == 0 || retval != 0) | |
| 487 | 487 | warn("key handler exited with non-zero return value: %d", retval); | |
| 488 | 488 | ||
| 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) | |
| 491 | 491 | { | |
| 492 | 492 | /* file has not changed */ | |
| 493 | + | win_set_cursor(&win, CURSOR_ARROW); | |
| 494 | + | set_timeout(reset_cursor, TO_CURSOR_HIDE, true); | |
| 493 | 495 | return; | |
| 494 | 496 | } | |
| 495 | 497 | if (mode == MODE_IMAGE) { | |