Guest User

Untitled

a guest
Jan 17th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. diff --git a/builtin/help.c b/builtin/help.c
  2. index 334a849..c2a3670 100644
  3. --- a/builtin/help.c
  4. +++ b/builtin/help.c
  5. @@ -32,6 +32,8 @@ enum help_format {
  6. HELP_FORMAT_WEB
  7. };
  8.  
  9. +static const char *manpage_canary = "/usr/share/doc/git-man/copyright";
  10. +
  11. static const char *html_path;
  12.  
  13. static int show_all = 0;
  14. @@ -342,8 +344,15 @@ static void show_man_page(const char *git_cmd)
  15. struct man_viewer_list *viewer;
  16. const char *page = cmd_to_page(git_cmd);
  17. const char *fallback = getenv("GIT_MAN_VIEWER");
  18. + struct stat throwaway;
  19. + int find_canary = 0;
  20.  
  21. setup_man_path();
  22. + find_canary = stat(manpage_canary, &throwaway);
  23. + if (find_canary == -1) {
  24. + printf(_("git: no man pages installed, please ask your system administrator to install the git-man package.\n"));
  25. + exit(0);
  26. + }
  27. for (viewer = man_viewer_list; viewer; viewer = viewer->next)
  28. {
  29. exec_viewer(viewer->name, page); /* will return when unable */
Add Comment
Please, Sign In to add comment