Commit Diff


commit - e08111f29f40db6013de92a2f63265255d647ee8
commit + c736b84ab8efb53399d58afe57a2e40c4c7dd1b5
blob - 232ab4c8aa553e2c4cf0a880fe27470a40b63e0f
blob + 8c21271a99fe7416ffc1a6b97ce8ce11403a6f35
--- tog/tog.c
+++ tog/tog.c
@@ -1707,8 +1707,10 @@ view_input(struct tog_view **new, int *done, struct to
 
 	if (using_mock_io) {
 		err = tog_read_script_key(tog_io.f, &ch, done);
-		if (err)
+		if (err) {
+			errcode = pthread_mutex_lock(&tog_mutex);
 			return err;
+		}
 	} else if (view->count && --view->count) {
 		cbreak();
 		nodelay(view->window, TRUE);