From: Ralph Corderoy Date: Sun, 23 Oct 2016 22:43:19 +0000 (+0100) Subject: Use HasPrefix() instead of strncmp(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/648dd5a3eb3c84fdef63b0b1123303741c17ddee?ds=inline Use HasPrefix() instead of strncmp(). --- diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 9c38a588..8360eecd 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -674,7 +674,7 @@ got_filename: int cwdlen = strlen (info->cwd); fprintf (stderr, " as file %s\n", - strncmp (ct->c_storage, info->cwd, cwdlen) + !HasPrefix(ct->c_storage, info->cwd) || ct->c_storage[cwdlen] != '/' ? ct->c_storage : ct->c_storage + cwdlen + 1); }