diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-12-18 20:53:47 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-12-18 20:53:47 +0000 |
commit | 4611741c8045229e41a7585952435ca4b852ebd4 (patch) | |
tree | 46fbb13e83f7300eab53f83f8844d9c50ee8be1c /package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch | |
parent | 49d29ae5c0f20b4342ad6374174967184cf445f8 (diff) | |
download | openwrt-4611741c8045229e41a7585952435ca4b852ebd4.tar.gz openwrt-4611741c8045229e41a7585952435ca4b852ebd4.zip |
AA: opkg: backport r34202 and r34203
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@34778 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch')
-rw-r--r-- | package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch b/package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch new file mode 100644 index 000000000..95406687b --- /dev/null +++ b/package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch @@ -0,0 +1,31 @@ +--- a/libopkg/pkg_parse.c ++++ b/libopkg/pkg_parse.c +@@ -20,6 +20,7 @@ + + #include <stdio.h> + #include <ctype.h> ++#include <unistd.h> + + #include "pkg.h" + #include "opkg_utils.h" +@@ -239,10 +240,16 @@ pkg_parse_line(void *ptr, const char *li + + case ' ': + if ((mask & PFM_DESCRIPTION) && reading_description) { +- pkg->description = xrealloc(pkg->description, +- strlen(pkg->description) +- + 1 + strlen(line) + 1); +- strcat(pkg->description, "\n"); ++ if (isatty(1)) { ++ pkg->description = xrealloc(pkg->description, ++ strlen(pkg->description) ++ + 1 + strlen(line) + 1); ++ strcat(pkg->description, "\n"); ++ } else { ++ pkg->description = xrealloc(pkg->description, ++ strlen(pkg->description) ++ + 1 + strlen(line)); ++ } + strcat(pkg->description, (line)); + goto dont_reset_flags; + } else if ((mask & PFM_CONFFILES) && reading_conffiles) { |