File: Xdialog.wrapper.c

package info (click to toggle)
xdialog 2.0.6-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,616 kB
  • ctags: 1,064
  • sloc: ansic: 8,505; sh: 4,202; yacc: 318; makefile: 80
file content (19 lines) | stat: -rw-r--r-- 395 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

int main (int argc, char **argv)
{
	char wrapped_cmd[1024];

	if (getenv("DISPLAY")) {
		setenv("XDIALOG_HIGH_DIALOG_COMPAT", "true", 0);
		setenv("XDIALOG_FORCE_AUTOSIZE", "true", 0);
		execvp("Xdialog", argv);
	} else {
		strcpy(wrapped_cmd, argv[0]);
		strcat(wrapped_cmd, ".wrapped");
		execvp(wrapped_cmd, argv);
	}
	return 0;
}