struct stat st;
int entlen;
- if (strncmp(de->d_name, "git-", 4))
+ if (prefixcmp(de->d_name, "git-"))
continue;
strcpy(path+dirlen, de->d_name);
if (stat(path, &st) || /* stat, not lstat */
puts("The most commonly used git commands are:");
for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
- printf(" %s", common_cmds[i].name);
- mput_char(' ', longest - strlen(common_cmds[i].name) + 4);
+ printf(" %s ", common_cmds[i].name);
+ mput_char(' ', longest - strlen(common_cmds[i].name));
puts(common_cmds[i].help);
}
puts("(use 'git help -a' to get a list of all installed git commands)");
{
const char *page;
- if (!strncmp(git_cmd, "git", 3))
+ if (!prefixcmp(git_cmd, "git"))
page = git_cmd;
else {
int page_len = strlen(git_cmd) + 4;