aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2005-01-06 19:31:12 +0000
committerJason Woodward2005-01-06 19:31:12 +0000
commit5b562bc1d3e751a1527923afdb4d3600443146c3 (patch)
tree502416fac5924b7b46f77e690ac771cc03e41ba2
parent188cd9dbf358b3c671db38c7c4710275ccb995db (diff)
downloadslapt-get-5b562bc1d3e751a1527923afdb4d3600443146c3.tar.gz
fixed bug in gen_short_pkg_description with installed packages that are missing a description, triggered by the new --search functionality looking at installed packages
-rw-r--r--ChangeLog3
-rw-r--r--src/package.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e75652e..654ad9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
0.9.9f Jan 06, 2005
+ * fixed bug in gen_short_pkg_description with installed packages that are
+ missing a description, triggered by the new --search functionality looking
+ at installed packages
* added Vietnamese translation by vu nguyen (vncasper at yahoo dot com)
* changed longopts and switch cases to use macros for the command line
argument parsing
diff --git a/src/package.c b/src/package.c
index 1bd3770..21c7cae 100644
--- a/src/package.c
+++ b/src/package.c
@@ -410,7 +410,9 @@ char *gen_short_pkg_description(pkg_info_t *pkg){
char *short_description = NULL;
size_t string_size = 0;
- string_size = strlen(pkg->description) - (strlen(pkg->name) + 2) - strlen( strchr(pkg->description,'\n') );
+ if( strchr(pkg->description,'\n') != NULL ){
+ string_size = strlen(pkg->description) - (strlen(pkg->name) + 2) - strlen( strchr(pkg->description,'\n') );
+ }
/* quit now if the description is going to be empty */
if( (int)string_size < 0 ) return NULL;