rpms/htop/F-10 htop-0.8.2-arrays.patch, NONE, 1.1 htop.spec, 1.19, 1.20

Rafał Psota rafalzaq at fedoraproject.org
Fri Jun 12 10:50:00 UTC 2009


Author: rafalzaq

Update of /cvs/pkgs/rpms/htop/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7970

Modified Files:
	htop.spec 
Added Files:
	htop-0.8.2-arrays.patch 
Log Message:
bz #504795 fixed

htop-0.8.2-arrays.patch:

--- NEW FILE htop-0.8.2-arrays.patch ---
Index: FunctionBar.c
===================================================================
--- FunctionBar.c	(revision 162)
+++ FunctionBar.c	(working copy)
@@ -52,12 +52,14 @@ FunctionBar* FunctionBar_new(char** func
       this->functions = malloc(sizeof(char*) * 15);
       this->keys = malloc(sizeof(char*) * 15);
       this->events = malloc(sizeof(int) * 15);
-      int i = 0;
-      while (i < 15 && functions[i]) {
+      int i;
+      for (i = 0; i < 15; i++) {
+         if (functions[i] == NULL) /* We don't know the size of the array,  */
+            break;                 /* so let's assume it is NULL terminated */
+                                   /* and break if we find that NULL        */
          this->functions[i] = String_copy(functions[i]);
          this->keys[i] = String_copy(keys[i]);
          this->events[i] = events[i];
-         i++;
       }
       this->size = i;
    } else {
Index: htop.c
===================================================================
--- htop.c	(revision 162)
+++ htop.c	(working copy)
@@ -151,7 +151,7 @@ static void showHelp(ProcessList* pl) {
    clear();
 }
 
-static char* CategoriesFunctions[10] = {"      ", "      ", "      ", "      ", "      ", "      ", "      ", "      ", "      ", "Done  "};
+static char* CategoriesFunctions[] = {"      ", "      ", "      ", "      ", "      ", "      ", "      ", "      ", "      ", "Done  ", NULL};
 
 static void Setup_run(Settings* settings, int headerHeight) {
    ScreenManager* scr = ScreenManager_new(0, headerHeight, 0, -1, HORIZONTAL, true);
@@ -190,7 +190,7 @@ static HandlerResult pickWithEnter(Panel
 }
 
 static Object* pickFromVector(Panel* panel, Panel* list, int x, int y, char** keyLabels, FunctionBar* prevBar) {
-   char* fuKeys[2] = {"Enter", "Esc"};
+   char* fuKeys[] = {"Enter", "Esc", NULL};
    int fuEvents[2] = {13, 27};
    if (!list->eventHandler)
       Panel_setEventHandler(list, pickWithEnter);
@@ -326,7 +326,7 @@ int main(int argc, char** argv) {
    Panel_setRichHeader(panel, ProcessList_printHeader(pl));
    
    char* searchFunctions[] = {"Next  ", "Exit  ", " Search: ", NULL};
-   char* searchKeys[] = {"F3", "Esc", "  "};
+   char* searchKeys[] = {"F3", "Esc", "  ", NULL};
    int searchEvents[] = {KEY_F(3), 27, ERR};
    FunctionBar* searchBar = FunctionBar_new(searchFunctions, searchKeys, searchEvents);
    
@@ -656,7 +656,7 @@ int main(int argc, char** argv) {
          
          Panel* affinityPanel = AffinityPanel_new(pl->processorCount, curr);
 
-         char* fuFunctions[2] = {"Set    ", "Cancel "};
+         char* fuFunctions[3] = {"Set    ", "Cancel ", NULL};
          void* set = pickFromVector(panel, affinityPanel, 15, headerHeight, fuFunctions, defaultBar);
          if (set) {
             unsigned long new = AffinityPanel_getAffinity(affinityPanel);
@@ -695,7 +695,7 @@ int main(int argc, char** argv) {
       {
          Panel* sortPanel = Panel_new(0, 0, 0, 0, LISTITEM_CLASS, true, ListItem_compare);
          Panel_setHeader(sortPanel, "Sort by");
-         char* fuFunctions[2] = {"Sort  ", "Cancel "};
+         char* fuFunctions[] = {"Sort  ", "Cancel ", NULL};
          ProcessField* fields = pl->fields;
          for (int i = 0; fields[i]; i++) {
             char* name = String_trim(Process_fieldTitles[fields[i]]);


Index: htop.spec
===================================================================
RCS file: /cvs/pkgs/rpms/htop/F-10/htop.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -p -r1.19 -r1.20
--- htop.spec	2 Jun 2009 12:05:57 -0000	1.19
+++ htop.spec	12 Jun 2009 10:49:29 -0000	1.20
@@ -1,6 +1,6 @@
 Name:           htop
 Version:        0.8.2
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Interactive process viewer
 Summary(pl):    Interaktywna przeglądarka procesów
 
@@ -10,6 +10,7 @@ URL:            http://htop.sourceforge.
 Source0:        http://download.sourceforge.net/htop/%{name}-%{version}.tar.gz
 #Patch0:         %{name}-0.8.1-nonprint.patch
 #Patch1:         %{name}-0.8.1-processlist.patch
+Patch2:         %{name}-0.8.2-arrays.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  desktop-file-utils
@@ -28,6 +29,7 @@ do top(1).
 %setup -q
 #%patch0 -p0
 #%patch1 -p0
+%patch2 -p0
 sed -i s#"INSTALL_DATA = @INSTALL_DATA@"#"INSTALL_DATA = @INSTALL_DATA@ -p"# Makefile.in
 #sed -i -e '2,3d' -e '9d' htop.desktop
 
@@ -47,8 +49,8 @@ desktop-file-install \
         $RPM_BUILD_ROOT%{_datadir}/applications/htop.desktop
 
 #remove empty direcories
-rm -rf $RPM_BUILD_ROOT%{prefix}/lib
-rm -rf $RPM_BUILD_ROOT%{prefix}/include
+rm -rf $RPM_BUILD_ROOT%{libdir}
+rm -rf $RPM_BUILD_ROOT%{includedir}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -64,6 +66,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Jun 12 2009 Rafał Psota <rafalzaq at gmail.com> - 0.8.2-2
+- "htop aborts after hitting F6 key" fixed (#504795)
+
 * Tue Jun 02 2009 Rafał Psota <rafalzaq at gmail.com> - 0.8.2-1
 - update to 0.8.2
 




More information about the fedora-extras-commits mailing list