about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNakidai <nakidai@disroot.org>2025-06-12 07:40:15 +0300
committerNakidai <nakidai@disroot.org>2025-06-12 07:40:15 +0300
commite844fa3336ceac39f3a0c268eaff908edbfb1a17 (patch)
tree3a4f0fef9f85a450570437dc33418df2a5b4fde1
parent881874cd9dfb57a5e4d2c7ac56e5878f7da6dc92 (diff)
downloadfp-e844fa3336ceac39f3a0c268eaff908edbfb1a17.tar.gz
fp-e844fa3336ceac39f3a0c268eaff908edbfb1a17.zip
Better search
-rw-r--r--fp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fp.c b/fp.c
index fa54bc3..6ff2447 100644
--- a/fp.c
+++ b/fp.c
@@ -89,10 +89,10 @@ int colcmp(const void *_left, const void *_right)
 	const struct result *left = _left, *right = _right;
 	if (left->c.length != right->c.length)
 		return left->c.length < right->c.length ? 1 : -1;
+	if (left->c.offset != right->c.offset)
+		return left->c.offset < right->c.offset ? -1 : 1;
 	if (left->c.fullness != right->c.fullness)
 		return left->c.fullness < right->c.fullness ? -1 : 1;
-	if (left->c.offset != right->c.offset)
-		return left->c.offset < right->c.offset ? 1 : -1;
 	return -strcmp(left->name, right->name);
 }