diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2010-08-20 03:43:07 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2010-08-20 03:43:07 +0000 |
commit | 0ae3738321067565c1afce17d6ccba8a0a985a60 (patch) | |
tree | 227a168a284ac70a4a2b3ec881a995a416d97b54 /packages | |
parent | 89f7ad17d05411a8c7b6a95a456d8578ea6d0975 (diff) |
accepted in git commit e210a2e2bba14324da3a38e5d7ac5f649082c28e
svn path=/trunk/; revision=13861
Diffstat (limited to 'packages')
-rw-r--r-- | packages/patches/add_tilde_support_toopen-0.41.4.patch | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/packages/patches/add_tilde_support_toopen-0.41.4.patch b/packages/patches/add_tilde_support_toopen-0.41.4.patch deleted file mode 100644 index ef854bba..00000000 --- a/packages/patches/add_tilde_support_toopen-0.41.4.patch +++ /dev/null @@ -1,71 +0,0 @@ -Index: s_path.c -=================================================================== ---- s_path.c (revision 9725) -+++ s_path.c (working copy) -@@ -22,6 +22,10 @@ - #include <io.h> - #endif - -+#ifdef MSW -+#include <windows.h> -+#endif -+ - #include <string.h> - #include "m_pd.h" - #include "m_imp.h" -@@ -69,6 +73,30 @@ - *to = 0; - } - -+/* expand env vars and ~ at the beginning of a path and make a copy to return */ -+static void sys_expandpath(const char *from, char *to) -+{ -+ if ((strlen(from) == 1 && from[0] == '~') || (strncmp(from,"~/", 2) == 0)) -+ { -+#ifdef MSW -+ const char *home = getenv("USERPROFILE"); -+#else -+ const char *home = getenv("HOME"); -+#endif -+ if(home) -+ { -+ strncpy(to, home, FILENAME_MAX - 1); -+ strncat(to, from + 1, FILENAME_MAX - strlen(from) - 2); -+ } -+ } -+ else -+ strncpy(to, from, FILENAME_MAX - 1); -+#ifdef MSW -+ char buf[FILENAME_MAX]; -+ ExpandEnvironmentStrings(to, buf, FILENAME_MAX - 2); -+ strncpy(to, buf, FILENAME_MAX - 1); -+#endif -+} - /******************* Utility functions used below ******************/ - - /*! -@@ -196,9 +224,11 @@ - char *dirresult, char **nameresult, unsigned int size, int bin) - { - int fd; -+ char buf[FILENAME_MAX]; - if (strlen(dir) + strlen(name) + strlen(ext) + 4 > size) - return (-1); -- strcpy(dirresult, dir); -+ sys_expandpath(dir, buf); -+ strcpy(dirresult, buf); - if (*dirresult && dirresult[strlen(dirresult)-1] != '/') - strcat(dirresult, "/"); - strcat(dirresult, name); -@@ -250,9 +280,9 @@ - int sys_open_absolute(const char *name, const char* ext, - char *dirresult, char **nameresult, unsigned int size, int bin, int *fdp) - { -- if (name[0] == '/' -+ if (name[0] == '/' || name[0] == '~' - #ifdef MSW -- || (name[1] == ':' && name[2] == '/') -+ || name[0] == '%' || (name[1] == ':' && name[2] == '/') - #endif - ) - { |