From b91b25e175a26b20319259e3dc7a432ead5af5fb Mon Sep 17 00:00:00 2001 From: Matteo Bernardini Date: Sat, 15 Sep 2012 09:12:25 +0200 Subject: audio/audtty: Updated for version 0.1.12. Added also some patches from git. Rewritten the gcc/DESTDIR patch Signed-off-by: Matteo Bernardini --- .../01-fix_segfault_in_playlist_creation.patch | 36 +++++++++ .../audtty/patches/02-fix_possible_overflow.patch | 22 ++++++ .../03-fix_segfault_and_possible_overflow.patch | 37 +++++++++ audio/audtty/patches/04-code_refactoring.patch | 91 ++++++++++++++++++++++ .../patches/audtty-0.1.12-cc-and-destdir.patch | 49 ++++++++++++ 5 files changed, 235 insertions(+) create mode 100644 audio/audtty/patches/01-fix_segfault_in_playlist_creation.patch create mode 100644 audio/audtty/patches/02-fix_possible_overflow.patch create mode 100644 audio/audtty/patches/03-fix_segfault_and_possible_overflow.patch create mode 100644 audio/audtty/patches/04-code_refactoring.patch create mode 100644 audio/audtty/patches/audtty-0.1.12-cc-and-destdir.patch (limited to 'audio/audtty/patches') diff --git a/audio/audtty/patches/01-fix_segfault_in_playlist_creation.patch b/audio/audtty/patches/01-fix_segfault_in_playlist_creation.patch new file mode 100644 index 0000000000..c0b426c91d --- /dev/null +++ b/audio/audtty/patches/01-fix_segfault_in_playlist_creation.patch @@ -0,0 +1,36 @@ +From 3122210cbe3ccd5e83d1a2d1415d370d46834052 Mon Sep 17 00:00:00 2001 +From: Chris Taylor +Date: Fri, 05 Mar 2010 06:09:20 +0000 +Subject: Fix segfault in playlist creation. + +Audtty would segfault if buffer length was 0 and ENTER was pressed. + + +Signed-off-by: Chris Taylor +--- +diff --git a/playlist_create.c b/playlist_create.c +index 0cd0088..475a494 100644 +--- a/playlist_create.c ++++ b/playlist_create.c +@@ -48,6 +48,11 @@ void playlist_create( void ) + case ESCAPE: + return; + case ENTER: ++ ++ if(strlen(buffer)==0) { ++ return; ++ } ++ else { + file=fopen(buffer,"w"); + for(i=0;i +Date: Fri, 05 Mar 2010 06:11:41 +0000 +Subject: Fix possible overflow. + +Signed-off-by: Chris Taylor +--- +diff --git a/playlist_create.c b/playlist_create.c +index 475a494..f8f84c5 100644 +--- a/playlist_create.c ++++ b/playlist_create.c +@@ -67,7 +67,7 @@ void playlist_create( void ) + buffer[--len] = '\0'; + break; + default: +- if (len == 1025) break; ++ if (len >= 1024) break; + if (c < 32) break; + buffer[len] = c; + buffer[++len] = '\0'; +-- +cgit v0.8.3.4-115-g1759 diff --git a/audio/audtty/patches/03-fix_segfault_and_possible_overflow.patch b/audio/audtty/patches/03-fix_segfault_and_possible_overflow.patch new file mode 100644 index 0000000000..e196954c9b --- /dev/null +++ b/audio/audtty/patches/03-fix_segfault_and_possible_overflow.patch @@ -0,0 +1,37 @@ +From c688fa3851263dc29075182ffdb1ab83051a7213 Mon Sep 17 00:00:00 2001 +From: Chris Taylor +Date: Fri, 05 Mar 2010 06:13:15 +0000 +Subject: Fix segfault and possible overflow. + +-Fix segfault when opening directory, and the buffer length is 0. +-Fix possible overflow in buffer. + +Signed-off-by: Chris Taylor +--- +diff --git a/browse.c b/browse.c +index fd06dee..c736e64 100644 +--- a/browse.c ++++ b/browse.c +@@ -399,16 +399,19 @@ void open_directory( void ) + get_contents(); + return; + case ENTER: ++ if(strlen(buffer)==0) return; ++ else { + cont.location=g_strdup(buffer); + g_chdir(buffer); + get_contents(); ++ } + return; + case KEY_BACKSPACE: + if (len == 0) break; + buffer[--len] = '\0'; + break; + default: +- if (len == 1025) break; ++ if (len >= 1024) break; + if (c < 32) break; + buffer[len] = c; + buffer[++len] = '\0'; +-- +cgit v0.8.3.4-115-g1759 diff --git a/audio/audtty/patches/04-code_refactoring.patch b/audio/audtty/patches/04-code_refactoring.patch new file mode 100644 index 0000000000..022d68c7c2 --- /dev/null +++ b/audio/audtty/patches/04-code_refactoring.patch @@ -0,0 +1,91 @@ +From ead43f353675d4c8952facf57920ce79533955a6 Mon Sep 17 00:00:00 2001 +From: Chris Taylor +Date: Fri, 05 Mar 2010 06:24:05 +0000 +Subject: Code refactoring. + +-Split browser creation code off into its own object. update_browser. +-If exiting from opening creation use update_browser() to repaint browser. + + +Signed-off-by: Chris Taylor +--- +diff --git a/browse.c b/browse.c +index c736e64..232d374 100644 +--- a/browse.c ++++ b/browse.c +@@ -50,7 +50,7 @@ void add_file(gboolean dir); + void remove_win( void ); + void display_error(gchar *message, gchar *name, gboolean type); + void open_directory( void ); +- ++void update_browser(void); + + void file_browser(gint height) + { +@@ -63,28 +63,15 @@ void file_browser(gint height) + cont.length = 1; + cont.first=0; + cont.pos_height=0; +- clear(); ++ clear(); + refresh(); +- ++ + browser.location = newwin(1, 0, 0, 0); + browser.title = newwin(1, 0, 1, 0); + browser.list = newwin(cont.height, 0, 3, 0); + +- +- wcolor_set(browser.location, 1, NULL); +- wcolor_set(browser.title, 1, NULL); +- wcolor_set(browser.list, 1, NULL); +- +- mvwtitledhline(browser.title, 0, "File Browser"); +- wnoutrefresh(browser.title); +- wnoutrefresh(browser.list); +- +- doupdate(); +- +- +- get_contents(); +- browser_paint(&cont); +- ++ update_browser(); ++ + while((c=getch())) + { + switch(c) +@@ -399,7 +386,10 @@ void open_directory( void ) + get_contents(); + return; + case ENTER: +- if(strlen(buffer)==0) return; ++ if(strlen(buffer)==0) { ++ update_browser(); ++ return; ++ } + else { + cont.location=g_strdup(buffer); + g_chdir(buffer); +@@ -429,4 +419,18 @@ void open_directory( void ) + doupdate(); + } + return; ++} ++ ++void update_browser(void) ++{ ++ wcolor_set(browser.location, 1, NULL); ++ wcolor_set(browser.title, 1, NULL); ++ wcolor_set(browser.list, 1, NULL); ++ mvwtitledhline(browser.title, 0, "File Browser"); ++ wnoutrefresh(browser.title); ++ wnoutrefresh(browser.list); ++ doupdate(); ++ get_contents(); ++ browser_paint(&cont); ++ return; + } +\ No newline at end of file +-- +cgit v0.8.3.4-115-g1759 diff --git a/audio/audtty/patches/audtty-0.1.12-cc-and-destdir.patch b/audio/audtty/patches/audtty-0.1.12-cc-and-destdir.patch new file mode 100644 index 0000000000..7ffdedba08 --- /dev/null +++ b/audio/audtty/patches/audtty-0.1.12-cc-and-destdir.patch @@ -0,0 +1,49 @@ +diff -Naur audtty-0.1.12.orig/Makefile.in audtty-0.1.12/Makefile.in +--- audtty-0.1.12.orig/Makefile.in 2010-02-28 19:10:48.000000000 +0100 ++++ audtty-0.1.12/Makefile.in 2012-09-15 09:06:34.570080268 +0200 +@@ -2,15 +2,14 @@ + # + # A fork of xmms-curses + +-DESTDIR= + # autoconf is dumb. +-prefix=${DESTDIR} ++prefix=/usr + exec_prefix=@prefix@ + bindir=@bindir@ +-mandir=@prefix@/share/man/man1 ++mandir=@prefix@/man/man1 + sysconfdir=@sysconfdir@ + +-AUDACIOUS_CFLAGS=@AUDACIOUS_CFLAGS@ -I/usr/include/dbus-1.0 ++AUDACIOUS_CFLAGS=@AUDACIOUS_CFLAGS@ -I/usr/include/dbus-1.0 -I/usr/lib@LIBDIRSUFFIX@/glib-2.0/include -I/usr/include/glib-2.0 + + SOURCES=main.c curses_printf.c playlist.c playlist_jump.c playlist_addurl.c settings.c connect.c browse.c playlist_create.c + BINS=$(SOURCES:.c=.o) +@@ -20,18 +19,18 @@ + all: audtty + + audtty: ${BINS} +- cc -g -O2 -g2 -Wall -Werror -lncursesw -laudclient ${LDFLAGS} -o audtty $(BINS) ++ $(CC) @SLKCFLAGS@ -Wall ${LDFLAGS} -lncursesw -laudclient -lglib-2.0 -ldbus-glib-1 -lgobject-2.0 -o audtty $(BINS) + + .c.o: +- cc -g -Wall ${AUDACIOUS_CFLAGS} ${CFLAGS} -o $@ -c $< ++ $(CC) -g -Wall ${AUDACIOUS_CFLAGS} ${CFLAGS} -o $@ -c $< + + install: audtty +- mkdir -p ${bindir} +- install -m 0755 audtty ${bindir}/audtty +- mkdir -p ${mandir} +- install -m 0644 audtty.1 ${mandir}/audtty.1 +- mkdir -p ${sysconfdir} +- install -m 0644 audtty.conf ${sysconfdir}/audtty.conf ++ mkdir -p $(DESTDIR)${bindir} ++ install -m 0755 audtty $(DESTDIR)${bindir}/audtty ++ mkdir -p $(DESTDIR)${mandir} ++ install -m 0644 audtty.1 $(DESTDIR)${mandir}/audtty.1 ++ mkdir -p $(DESTDIR)${sysconfdir} ++ install -m 0644 audtty.conf $(DESTDIR)${sysconfdir}/audtty.conf + + uninstall: + rm ${bindir}/audtty || false -- cgit v1.2.3