From: Rusty Russell Date: Tue, 31 Mar 2009 19:05:36 +0000 (-0600) Subject: strstarts: helper function for !strncmp(str, prefix, strlen(prefix)) X-Git-Tag: v2.6.30-rc1~206^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66f92cf9d415e96a5bdd6c64de8dd8418595d2fc;p=pandora-kernel.git strstarts: helper function for !strncmp(str, prefix, strlen(prefix)) Impact: minor new API ksplice added a "starts_with" function, which seems like a common need. When people open-code it they seem to use fixed numbers rather than strlen, so it's quite a readability win (also, strncmp() almost always wants != 0 on it). So here's strstarts(). Cc: Anders Kaseorg Cc: Jeff Arnold Cc: Tim Abbott Signed-off-by: Rusty Russell --- Reading git-diff-tree failed