X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=scrotwm.c;h=e0952156c8ac6534c1cd5f7b475162b1a9d87b73;hb=60d2953634a89f9ed05d6969806e5c61de403b55;hp=47e73191acec7a419541b448eb09938de107e323;hpb=9c3aa396f4b0e3dfe37a4f7784ca008a6f5046d0;p=spectrwm.git diff --git a/scrotwm.c b/scrotwm.c index 47e7319..e095215 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -51,11 +51,6 @@ * DEALINGS IN THE SOFTWARE. */ -static const char *cvstag = - "$scrotwm$"; - -#define SWM_VERSION "0.9.34" - #include #include #include @@ -92,6 +87,14 @@ static const char *cvstag = #include #endif +#include "version.h" + +#ifdef SCROTWM_BUILDSTR +static const char *buildstr = SCROTWM_BUILDSTR; +#else +static const char *buildstr = SCROTWM_VERSION; +#endif + #if RANDR_MAJOR < 1 # error XRandR versions less than 1.0 are not supported #endif @@ -1540,8 +1543,8 @@ version(struct swm_region *r, union arg *args) { bar_version = !bar_version; if (bar_version) - snprintf(bar_vertext, sizeof bar_vertext, "Version: %s CVS: %s", - SWM_VERSION, cvstag); + snprintf(bar_vertext, sizeof bar_vertext, "Version: %s Build: %s", + SCROTWM_VERSION, buildstr); else strlcpy(bar_vertext, "", sizeof bar_vertext); bar_update(); @@ -3214,7 +3217,7 @@ search_do_resp(void) if ((resp = calloc(1, MAX_RESP_LEN + 1)) == NULL) { fprintf(stderr, "search: calloc\n"); - return; + goto done; } rbytes = read(select_resp_pipe[0], resp, MAX_RESP_LEN); @@ -3246,6 +3249,7 @@ search_do_resp(void) free(s); } done: + close(select_resp_pipe[0]); free(resp); } @@ -6321,8 +6325,8 @@ main(int argc, char *argv[]) struct sigaction sact; start_argv = argv; - fprintf(stderr, "Welcome to scrotwm V%s cvs tag: %s\n", - SWM_VERSION, cvstag); + fprintf(stderr, "Welcome to scrotwm V%s Build: %s\n", + SCROTWM_VERSION, buildstr); if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) warnx("no locale support");