URL: <https://savannah.gnu.org/bugs/?67603>
Summary: Incorrect motion to target character
Group: GNU Screen
Submitter: None
Submitted: Tue 14 Oct 2025 12:27:40 AM UTC
Category: User Interface
Severity: 3 - Normal
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Release: 5.0.1
Fixed Release: None
Planned Release: None
Work Required: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Tue 14 Oct 2025 12:27:40 AM UTC By: Anonymous
I caught a bug in forward (and backward) motion to a target character [1].
The motion appears to be out of place.
To reproduce this bug on version 5.0.1 or master branch:
1. Print a line on terminal: echo "hello world"
hello world
2. Enter copy mode, move to the start of the line, then try to forward motion
to target character 'l'. This should produce an incorrect jump.
The cause appears to be the incorrect counting of character offset based on
type `char` instead of `uint32_t`, in `nextchar()` function in `mark.c`.
Another potential issue is downcasting of `uint32_t*` to `char*` pointer then
compare the first byte. This is incorrect on big-endian architecture.
I found a fix in [2].
[1] https://www.gnu.org/software/screen/manual/html_node/Movement.html
[2] attachment
_______________________________________________________
File Attachments:
Proposed fix to the bug described above
Name: fix-fFtT-motion-keys.patch Size: 924B
<https://file.savannah.gnu.org/file/fix-fFtT-motion-keys.patch?file_id=57717>
AGPL NOTICE
These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-67e8243f405dc86e3d2806ae92f56702db23371d.tar.gz
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67603>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
