home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.207 < prev    next >
Encoding:
Internet Message Format  |  2002-02-09  |  6.6 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.207 (extra)
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.207 (extra)
  11. Problem:    Win32: The shortcuts and start menu entries let Vim startup in the
  12.         desktop directory, which is not very useful.
  13. Solution:   Let shortcuts start Vim in $HOME or $HOMEDIR$HOMEPATH.
  14. Files:        src/dosinst.c
  15.  
  16.  
  17. *** ../vim60.206/src/dosinst.c    Sun Feb 10 12:57:34 2002
  18. --- src/dosinst.c    Sun Feb 10 16:28:26 2002
  19. ***************
  20. *** 32,37 ****
  21. --- 32,38 ----
  22.                        directory to write .bat files in */
  23.   char    *default_vim_dir = NULL;  /* when not NULL, use this as the default
  24.                        install dir for NSIS */
  25. + char    homedir[BUFSIZE];    /* home directory or "" */
  26.   
  27.   /*
  28.    * Structure used for each choice the user can make.
  29. ***************
  30. *** 677,682 ****
  31. --- 678,714 ----
  32.       fclose(fd);
  33.       else
  34.       *oldvimrc = NUL;
  35. +     /*
  36. +      * Get default home directory.
  37. +      * Prefer $HOME if it's set.  For Win NT use $HOMEDRIVE and $HOMEPATH.
  38. +      * Otherwise, if there is a "c:" drive use that.
  39. +      */
  40. +     p = getenv("HOME");
  41. +     if (p != NULL && *p != NUL && strlen(p) < BUFSIZE)
  42. +     strcpy(homedir, p);
  43. +     else
  44. +     {
  45. +     p = getenv("HOMEDRIVE");
  46. +     if (p != NULL && *p != NUL && strlen(p) + 2 < BUFSIZE)
  47. +     {
  48. +         strcpy(homedir, p);
  49. +         p = getenv("HOMEPATH");
  50. +         if (p != NULL && *p != NUL && strlen(homedir) + strlen(p) < BUFSIZE)
  51. +         strcat(homedir, p);
  52. +         else
  53. +         strcat(homedir, "\\");
  54. +     }
  55. +     else
  56. +     {
  57. +         struct stat st;
  58. +         if (stat("c:\\", &st) == 0)
  59. +         strcpy(homedir, "c:\\");
  60. +         else
  61. +         *homedir = NUL;
  62. +     }
  63. +     }
  64.   }
  65.   
  66.   /*
  67. ***************
  68. *** 1519,1558 ****
  69.       printf("Creating start menu\n");
  70.       if (has_vim)
  71.       {
  72. !     if (build_shortcut("Vim", "vim.exe", "", VIM_STARTMENU, "") == FAIL)
  73.           return;
  74. !     if (build_shortcut("Vim Read-only", "vim.exe", "-R", VIM_STARTMENU, "")
  75. !                                       == FAIL)
  76.           return;
  77. !     if (build_shortcut("Vim Diff", "vim.exe", "-d", VIM_STARTMENU, "")
  78. !                                       == FAIL)
  79.           return;
  80.       }
  81.       if (has_gvim)
  82.       {
  83. !     if (build_shortcut("gVim", "gvim.exe", "", VIM_STARTMENU, "") == FAIL)
  84.           return;
  85.       if (build_shortcut("gVim Easy", "gvim.exe", "-y",
  86. !                            VIM_STARTMENU, "") == FAIL)
  87.           return;
  88.       if (build_shortcut("gVim Read-only", "gvim.exe", "-R",
  89. !                            VIM_STARTMENU, "") == FAIL)
  90.           return;
  91.       if (build_shortcut("gVim Diff", "gvim.exe", "-d",
  92. !                            VIM_STARTMENU, "") == FAIL)
  93.           return;
  94.       }
  95.       if (build_shortcut("Uninstall",
  96. !         interactive ? "uninstal.exe" : "uninstall-gui.exe",
  97. !                            "", VIM_STARTMENU, "") == FAIL)
  98.       return;
  99.       /* For Windows NT the working dir of the vimtutor.bat must be right,
  100.        * otherwise gvim.exe won't be found and using gvimbat doesn't work. */
  101. !     if (build_shortcut("Vim tutor", "vimtutor.bat", "", VIM_STARTMENU,
  102. !                               installdir) == FAIL)
  103.       return;
  104.       if (build_shortcut("Help", has_gvim ? "gvim.exe" : "vim.exe", "-c h",
  105. !                            VIM_STARTMENU, "") == FAIL)
  106.       return;
  107.       {
  108.       char    shell_folder_path[BUFSIZE];
  109. --- 1551,1592 ----
  110.       printf("Creating start menu\n");
  111.       if (has_vim)
  112.       {
  113. !     if (build_shortcut("Vim", "vim.exe", "",
  114. !                           VIM_STARTMENU, homedir) == FAIL)
  115.           return;
  116. !     if (build_shortcut("Vim Read-only", "vim.exe", "-R",
  117. !                           VIM_STARTMENU, homedir) == FAIL)
  118.           return;
  119. !     if (build_shortcut("Vim Diff", "vim.exe", "-d",
  120. !                           VIM_STARTMENU, homedir) == FAIL)
  121.           return;
  122.       }
  123.       if (has_gvim)
  124.       {
  125. !     if (build_shortcut("gVim", "gvim.exe", "",
  126. !                           VIM_STARTMENU, homedir) == FAIL)
  127.           return;
  128.       if (build_shortcut("gVim Easy", "gvim.exe", "-y",
  129. !                           VIM_STARTMENU, homedir) == FAIL)
  130.           return;
  131.       if (build_shortcut("gVim Read-only", "gvim.exe", "-R",
  132. !                           VIM_STARTMENU, homedir) == FAIL)
  133.           return;
  134.       if (build_shortcut("gVim Diff", "gvim.exe", "-d",
  135. !                           VIM_STARTMENU, homedir) == FAIL)
  136.           return;
  137.       }
  138.       if (build_shortcut("Uninstall",
  139. !         interactive ? "uninstal.exe" : "uninstall-gui.exe", "",
  140. !                        VIM_STARTMENU, installdir) == FAIL)
  141.       return;
  142.       /* For Windows NT the working dir of the vimtutor.bat must be right,
  143.        * otherwise gvim.exe won't be found and using gvimbat doesn't work. */
  144. !     if (build_shortcut("Vim tutor", "vimtutor.bat", "",
  145. !                        VIM_STARTMENU, installdir) == FAIL)
  146.       return;
  147.       if (build_shortcut("Help", has_gvim ? "gvim.exe" : "vim.exe", "-c h",
  148. !                           VIM_STARTMENU, homedir) == FAIL)
  149.       return;
  150.       {
  151.       char    shell_folder_path[BUFSIZE];
  152. ***************
  153. *** 1604,1610 ****
  154.       /* Create shortcut(s) on the desktop */
  155.       if (choices[idx].arg)
  156.       {
  157. !     (void)build_shortcut(icon_names[0], "gvim.exe", "", "desktop", "");
  158.       need_uninstall_entry = 1;
  159.       }
  160.   }
  161. --- 1638,1645 ----
  162.       /* Create shortcut(s) on the desktop */
  163.       if (choices[idx].arg)
  164.       {
  165. !     (void)build_shortcut(icon_names[0], "gvim.exe",
  166. !                               "", "desktop", homedir);
  167.       need_uninstall_entry = 1;
  168.       }
  169.   }
  170. ***************
  171. *** 1614,1620 ****
  172.   {
  173.       if (choices[idx].arg)
  174.       {
  175. !     (void)build_shortcut(icon_names[1], "gvim.exe", "-y", "desktop", "");
  176.       need_uninstall_entry = 1;
  177.       }
  178.   }
  179. --- 1649,1656 ----
  180.   {
  181.       if (choices[idx].arg)
  182.       {
  183. !     (void)build_shortcut(icon_names[1], "gvim.exe",
  184. !                             "-y", "desktop", homedir);
  185.       need_uninstall_entry = 1;
  186.       }
  187.   }
  188. ***************
  189. *** 1624,1630 ****
  190.   {
  191.       if (choices[idx].arg)
  192.       {
  193. !     (void)build_shortcut(icon_names[2], "gvim.exe", "-R", "desktop", "");
  194.       need_uninstall_entry = 1;
  195.       }
  196.   }
  197. --- 1660,1667 ----
  198.   {
  199.       if (choices[idx].arg)
  200.       {
  201. !     (void)build_shortcut(icon_names[2], "gvim.exe",
  202. !                             "-R", "desktop", homedir);
  203.       need_uninstall_entry = 1;
  204.       }
  205.   }
  206. *** ../vim60.206/src/version.c    Sun Feb 10 14:27:03 2002
  207. --- src/version.c    Sun Feb 10 16:31:14 2002
  208. ***************
  209. *** 608,609 ****
  210. --- 608,611 ----
  211.   {   /* Add new patch number below this line */
  212. + /**/
  213. +     207,
  214.   /**/
  215.  
  216. -- 
  217. ARTHUR:    Well, it doesn't matter.  Will you go and tell your master that
  218.            Arthur from the Court of Camelot is here.
  219. GUARD #1:  Listen, in order to maintain air-speed velocity, a swallow
  220.            needs to beat its wings 43 times every second, right?
  221. ARTHUR:    Please!
  222.                                   The Quest for the Holy Grail (Monty Python)
  223.  
  224.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  225. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  226.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  227.