- Check return values of system() calls (stolen from ubuntu)

- Fix manpage errors and remove USE_GROFF
This commit is contained in:
dcoppa 2012-10-25 13:43:42 +00:00
parent 617b2aed1b
commit 60060e8d62
4 changed files with 67 additions and 3 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.13 2012/09/28 12:56:03 dcoppa Exp $
# $OpenBSD: Makefile,v 1.14 2012/10/25 13:43:42 dcoppa Exp $
COMMENT = ncurses mpd client inspired by ncmpc
DISTNAME = ncmpcpp-0.5.10
REVISION = 1
REVISION = 2
EXTRACT_SUFX = .tar.bz2
@ -31,7 +31,6 @@ LIB_DEPENDS = audio/libmpdclient>=2.4 \
MODULES = devel/gettext
USE_GROFF = Yes
USE_LIBTOOL = Yes
CONFIGURE_STYLE = gnu

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-doc_ncmpcpp_1,v 1.1 2012/10/25 13:43:42 dcoppa Exp $
--- doc/ncmpcpp.1.orig Sun Apr 1 18:49:09 2012
+++ doc/ncmpcpp.1 Thu Oct 25 15:31:48 2012
@@ -50,7 +50,6 @@ Switch to previous song and exit.
.TP
.B volume [+-]<number>
Raise/lower volume by given number of percents and exit.
-.TP
.SH "CONFIGURATION"
When ncmpcpp starts, it tries to read user's settings from the ~/.ncmpcpp/config file. If no user's configuration is found, ncmpcpp uses its default configuration. An example configuration file containing all default values is provided with ncmpcpp and can be found usually in /usr/share/doc/ncmpcpp (exact location may depend on used distribution/OS/configure prefix).
@@ -377,7 +376,6 @@ Color of visualization.
.TP
.B active_window_border = COLOR
Color of active window's border.
-.TP
.SH "KEYS"
When ncmpcpp starts, it tries to read user's keybindings from ~/.ncmpcpp/keys file. If no user's keybindings is found, ncmpcpp uses its default keybindings. An example keybindings file containing all default values is provided with ncmpcpp and can be found usually in /usr/share/doc/ncmpcpp (exact location may depend on used distribution/OS/configure prefix).

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-src_lyrics_cpp,v 1.1 2012/10/25 13:43:42 dcoppa Exp $
Check return values of system() calls
--- src/lyrics.cpp.orig Sun Apr 1 18:49:09 2012
+++ src/lyrics.cpp Thu Oct 25 15:14:57 2012
@@ -377,15 +377,20 @@ void Lyrics::Edit()
if (Config.use_console_editor)
{
- system(("/bin/sh -c \"" + Config.external_editor + " \\\"" + itsFilename + "\\\"\"").c_str());
+ if (system(("/bin/sh -c \"" + Config.external_editor + " \\\"" + itsFilename + "\\\"\"").c_str()) < 0)
+ {
+ ShowMessage("Couldn't edit lyrics");
+ return;
+ }
+
// below is needed as screen gets cleared, but apparently
// ncurses doesn't know about it, so we need to reload main screen
endwin();
initscr();
curs_set(0);
}
- else
- system(("nohup " + Config.external_editor + " \"" + itsFilename + "\" > /dev/null 2>&1 &").c_str());
+ else if (system(("nohup " + Config.external_editor + " \"" + itsFilename + "\" > /dev/null 2>&1 &").c_str()) < 0)
+ ShowMessage("Couldn't edit lyrics");
}
#ifdef HAVE_CURL_CURL_H

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-src_status_cpp,v 1.3 2012/10/25 13:43:42 dcoppa Exp $
Check return values of system() call
--- src/status.cpp.orig Sun Apr 1 18:49:09 2012
+++ src/status.cpp Thu Oct 25 15:14:57 2012
@@ -401,7 +401,8 @@ void NcmpcppStatusChanged(MPD::Connection *, MPD::Stat
if (myPlaylist->isPlaying())
{
if (!Config.execute_on_song_change.empty())
- system(Config.execute_on_song_change.c_str());
+ if (system(Config.execute_on_song_change.c_str()) < 0)
+ ShowMessage("Couldn't execute \"%s\"", Config.execute_on_song_change.c_str());
# ifdef HAVE_CURL_CURL_H
if (Config.fetch_lyrics_in_background)