Rafał Psota 16 years ago
parent 16d00a627a
commit 1d8cee3df1

@ -0,0 +1,71 @@
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]]);

@ -1,6 +1,6 @@
Name: htop Name: htop
Version: 0.8.2 Version: 0.8.2
Release: 1%{?dist} Release: 2%{?dist}
Summary: Interactive process viewer Summary: Interactive process viewer
Summary(pl): Interaktywna przeglądarka procesów Summary(pl): Interaktywna przeglądarka procesów
@ -10,6 +10,7 @@ URL: http://htop.sourceforge.net/
Source0: http://download.sourceforge.net/htop/%{name}-%{version}.tar.gz Source0: http://download.sourceforge.net/htop/%{name}-%{version}.tar.gz
#Patch0: %{name}-0.8.1-nonprint.patch #Patch0: %{name}-0.8.1-nonprint.patch
#Patch1: %{name}-0.8.1-processlist.patch #Patch1: %{name}-0.8.1-processlist.patch
Patch2: %{name}-0.8.2-arrays.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
@ -28,6 +29,7 @@ do top(1).
%setup -q %setup -q
#%patch0 -p0 #%patch0 -p0
#%patch1 -p0 #%patch1 -p0
%patch2 -p0
sed -i s#"INSTALL_DATA = @INSTALL_DATA@"#"INSTALL_DATA = @INSTALL_DATA@ -p"# Makefile.in sed -i s#"INSTALL_DATA = @INSTALL_DATA@"#"INSTALL_DATA = @INSTALL_DATA@ -p"# Makefile.in
#sed -i -e '2,3d' -e '9d' htop.desktop #sed -i -e '2,3d' -e '9d' htop.desktop
@ -47,8 +49,8 @@ desktop-file-install \
$RPM_BUILD_ROOT%{_datadir}/applications/htop.desktop $RPM_BUILD_ROOT%{_datadir}/applications/htop.desktop
#remove empty direcories #remove empty direcories
rm -rf $RPM_BUILD_ROOT%{prefix}/lib rm -rf $RPM_BUILD_ROOT%{libdir}
rm -rf $RPM_BUILD_ROOT%{prefix}/include rm -rf $RPM_BUILD_ROOT%{includedir}
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -64,13 +66,15 @@ rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Fri Jun 12 2009 Rafał Psota <rafalzaq@gmail.com> - 0.8.2-2
- "htop aborts after hitting F6 key" fixed (#504795)
* Tue Jun 02 2009 Rafał Psota <rafalzaq@gmail.com> - 0.8.2-1 * Tue Jun 02 2009 Rafał Psota <rafalzaq@gmail.com> - 0.8.2-1
- update to 0.8.2 - update to 0.8.2
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.1-4 * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Thu Feb 05 2009 Rafał Psota <rafalzaq@gmail.com> - 0.8.1-3 * Thu Feb 05 2009 Rafał Psota <rafalzaq@gmail.com> - 0.8.1-3
- "Tree view doesn't work with threads hidden" fixed (#481072) - "Tree view doesn't work with threads hidden" fixed (#481072)

Loading…
Cancel
Save