/* dialog-wrapper.c - Simple "dialog" wrapper. */ /* ------------------------------------------------------------ */ /* This wrapper assumes that the "real" version of "dialog" has */ /* been moved to a file named "dialog.bin" located in the local */ /* packages "bin" directory. */ /* Note: __META_BINDIR__ is a preprocessor definition that */ /* specifies the "bin" directory in question. */ /* This wrapper simply chains to the "real" version, with one */ /* change: If TERM is equal to "xterm", the wrapper changes */ /* TERM to "xterm-color". */ /* ------------------------------------------------------------ */ #include #define ZERO 0 #define NULLCP ((char *) ZERO) int main (int argc, char **argv) { char *term = getenv ("TERM"); if ((term != NULLCP) && !strcmp (term, "xterm")) { putenv ("TERM=xterm-color"); } argv [ZERO] = __META_BINDIR__ "/dialog.bin"; execv (argv [ZERO], argv); return (ZERO); }