aboutsummaryrefslogtreecommitdiffstats
path: root/main/fish/fish-safe-strerror.patch
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2013-09-19 14:09:05 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2013-09-19 14:09:29 +0000
commit5c5f4f6002d15a6c662d4f3ef7f16fa6a64d3b65 (patch)
tree4c8ec406abc0dd70f63bc7965a6db5769c6e9bb9 /main/fish/fish-safe-strerror.patch
parent59541b8beffed564b87186e8a652e0f4938b5c0d (diff)
downloadaports-5c5f4f6002d15a6c662d4f3ef7f16fa6a64d3b65.tar.bz2
aports-5c5f4f6002d15a6c662d4f3ef7f16fa6a64d3b65.tar.xz
main/fish: new aport
Diffstat (limited to 'main/fish/fish-safe-strerror.patch')
-rw-r--r--main/fish/fish-safe-strerror.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/main/fish/fish-safe-strerror.patch b/main/fish/fish-safe-strerror.patch
new file mode 100644
index 0000000000..e596da108b
--- /dev/null
+++ b/main/fish/fish-safe-strerror.patch
@@ -0,0 +1,31 @@
+--- fish/wutil.cpp
++++ fish.orig/wutil.cpp
+@@ -319,27 +319,7 @@
+
+ const char *safe_strerror(int err)
+ {
+- if (err >= 0 && err < sys_nerr && sys_errlist[err] != NULL)
+- {
+- return sys_errlist[err];
+- }
+- else
+- {
+- int saved_err = errno;
+-
+- /* Use a shared buffer for this case */
+- static char buff[384];
+- char errnum_buff[64];
+- format_long_safe(errnum_buff, err);
+-
+- buff[0] = '\0';
+- safe_append(buff, "unknown error (errno was ", sizeof buff);
+- safe_append(buff, errnum_buff, sizeof buff);
+- safe_append(buff, ")", sizeof buff);
+-
+- errno = saved_err;
+- return buff;
+- }
++ return strerror(err);
+ }
+
+ void safe_perror(const char *message)