summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_main_process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_main_process.c')
-rw-r--r--src/nxt_main_process.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nxt_main_process.c b/src/nxt_main_process.c
index 110867ca..4043d026 100644
--- a/src/nxt_main_process.c
+++ b/src/nxt_main_process.c
@@ -1026,6 +1026,16 @@ nxt_app_lang_compare(const void *v1, const void *v2)
lang1 = v1;
lang2 = v2;
+ if (lang1->type.length != lang2->type.length) {
+ return lang1->type.length - lang2->type.length;
+ }
+
+ n = nxt_strncmp(lang1->type.start, lang2->type.start, lang1->type.length);
+
+ if (n != 0) {
+ return n;
+ }
+
length = nxt_min(lang1->version.length, lang2->version.length);
n = nxt_strncmp(lang1->version.start, lang2->version.start, length);