aruu

[MIRROR] Actual replacement for Busybox | suckless
git clone https://git.daat.foo/aruu.git
Log | Files | Refs | README | LICENSE

linecmp.c (308B)


      1 /* see LICENSE file for copyright and license details */
      2 #include <stdio.h>
      3 #include <string.h>
      4 
      5 #include "../text.h"
      6 #include "../util.h"
      7 
      8 int
      9 linecmp(struct line *a, struct line *b)
     10 {
     11   int res = 0;
     12 
     13   if (!(res = memcmp(a->data, b->data, MIN(a->len, b->len))))
     14     res = a->len - b->len;
     15 
     16   return res;
     17 }