Skip to content

Instantly share code, notes, and snippets.

@flatcap
Last active September 17, 2018 20:55
Show Gist options
  • Save flatcap/e7b597b8e7829983ed76f1737751c46b to your computer and use it in GitHub Desktop.
Save flatcap/e7b597b8e7829983ed76f1737751c46b to your computer and use it in GitHub Desktop.
dirname
char *mutt_file_dirname(const char *path)
{
char *copy = mutt_str_strdup(path);
char *dir = dirname(copy);
if (dir != copy)
{
FREE(&copy);
dir = strdup(dir);
}
return dir;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment