summary refs log tree commit diff stats
path: root/doc/ranger.1
Commit message (Expand)AuthorAgeFilesLines
* Update the manpage: add --show-only-dirsWojciech Siewierski2017-06-161-1/+6
* commands: cd: Implement smart tab completion with less typingnfnty2017-03-261-1/+4
* doc: ranger: Reorder some settingsnfnty2017-03-191-8/+8
* commands: Add setting for cd tab completion case sensitivityDmitry Kryukov2017-03-191-0/+9
* Add ability to save/restore tabsVitaly Belman2017-03-191-1/+6
* Beta release 1.9.0b5 v1.9.0b5nfnty2017-02-191-1/+1
* doc: man: Clarify config sourcingnfnty2017-02-161-13/+10
* Beta release 1.9.0b4 v1.9.0b4nfnty2017-02-101-1/+1
* Beta release 1.9.0b3 v1.9.0b3nfnty2017-02-101-1/+1
* Beta release 1.9.0b2 v1.9.0b2nfnty2017-02-101-1/+1
* Beta release 1.9.0b1 v1.9.0b1nfnty2017-02-101-1/+1
* commands: Add `quitall!`, Change behavior of `quit!`nfnty2017-02-091-7/+9
* config.commands: quit, quitall: Don't exit if loader has workSamuel Walladge2017-02-081-4/+11
* core.main: Catch the right tracebacknfnty2017-02-061-2/+2
* Add `$XDG_DATA_HOME` supportnfnty2017-02-051-2/+11
* Add setting `wrap_scroll`Samuel Walladge2017-02-051-1/+5
* commands: rename_append: Add flagsnfnty2017-02-011-32/+32
* Add command for jumping to first non-directory/non-fileThe Flying Rapist2017-02-011-1/+10
* "title bar" -> "titlebar"nfnty2017-01-291-1/+1
* Add setting `hostname_in_titlebar`nfnty2017-01-291-1/+4
* config.commands: `setlocal`: Properly parse path with spacesnfnty2017-01-241-1/+4
* ranger in danger because of some stranger v1.8.1hut2017-01-081-1/+1
* git commit -m 'git commit -m git\ commit\ -m\ '\''Happy\ Holidays\!'\' v1.8.0hut2016-12-241-14/+10
* Fix the urxvt preview documentationWojciech Siewierski2016-10-081-4/+4
* Implement the urxvt-based image previewsWojciech Siewierski2016-10-051-10/+32
* manpage: rebuildhut2016-09-031-13/+10
* manpage: Document how to escape macroshut2016-09-031-2/+4
* merge setting "relative_line_numbers" into "line_numbers"hut2016-05-241-7/+9
* Merge branch 'linum' of https://github.com/mrogalski/rangerhut2016-05-241-1/+8
|\
| * Add man description.Mark Rogalski2016-05-161-1/+8
* | Manpage: added documentation about commands in pluginshut2016-05-241-2/+6
|/
* `draw_progress_bar_in_statusbar' does not existmrogalski2016-05-111-2/+2
* doc/ranger.1: document :source commandhut2016-04-151-1/+11
* rebuilt man pagehut2016-04-061-0/+5
* allow toggling options with `:set <option>!`hut2016-04-031-1/+7
* doc/ranger.1: Added documentation for {yd}{art} key bindingshut2016-03-251-3/+6
* rebuild man pageshut2016-02-241-5/+13
* ranger.pod: describe that :setlocal path is a regexhut2016-01-011-1/+5
* Added :echo command, disabled :notify commandhut2015-11-141-1/+5
* Fixed that rare bug with the fireballs and explosions v1.7.2hut2015-10-041-1/+1
* rc.conf: added pP/pO keys for FIFO-queued copying, fixes #345hut2015-10-041-2/+6
* Initial commit v1.7.1hut2015-05-041-1/+1
* Should I dual ranger/cleric or wait for the THAC0 bonus? v1.7.0hut2015-04-141-1/+1
* doc/ranger.1: fix paths in RESOURCES sectionhut2015-04-131-3/+3
* moved "doc/examples" to "examples" for more visibilityhut2015-04-131-1/+1
* doc/ranger.1: updated RESOURCES sectionhut2015-04-131-2/+7
* doc/ranger.1: added entries for :help and :setintaghut2015-04-131-1/+11
* ranger.1: added documentation for %rangerdir and %space macroshut2015-04-101-1/+9
* new linemode with the information from file(1)Wojciech Siewierski2015-03-301-2/+6
* Consolidate image preview method preferencesDelisa Mason2015-03-091-2/+2
: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
 * See LICENSE file for license details.
 */

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>

#include "dwm.h"

void
error(const char *errstr, ...) {
	va_list ap;
	va_start(ap, errstr);
	vfprintf(stderr, errstr, ap);
	va_end(ap);
	exit(1);
}

static void
bad_malloc(unsigned int size)
{
	fprintf(stderr, "fatal: could not malloc() %d bytes\n",
			(int) size);
	exit(1);
}

void *
emallocz(unsigned int size)
{
	void *res = calloc(1, size);
	if(!res)
		bad_malloc(size);
	return res;
}

void *
emalloc(unsigned int size)
{
	void *res = malloc(size);
	if(!res)
		bad_malloc(size);
	return res;
}

void *
erealloc(void *ptr, unsigned int size)
{
	void *res = realloc(ptr, size);
	if(!res)
		bad_malloc(size);
	return res;
}

char *
estrdup(const char *str)
{
	char *res = strdup(str);
	if(!res)
		bad_malloc(strlen(str));
	return res;
}

void
swap(void **p1, void **p2)
{
	void *tmp = *p1;
	*p1 = *p2;
	*p2 = tmp;
}

void
spawn(char *argv[])
{
	if(!argv || !argv[0])
		return;
	if(fork() == 0) {
		if(fork() == 0) {
			if(dpy)
				close(ConnectionNumber(dpy));
			setsid();
			execvp(argv[0], argv);
			fprintf(stderr, "dwm: execvp %s", argv[0]);
			perror(" failed");
		}
		exit (0);
	}
	wait(0);
}