cvsimport

This commit is contained in:
Christian Neukirchen
2015-01-22 11:06:01 +01:00
15 changed files with 44 additions and 26 deletions

View File

@@ -18,13 +18,14 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <sys/wait.h> #include <sys/wait.h>
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <getopt.h> #include <getopt.h>
#include <limits.h>
#include <locale.h> #include <locale.h>
#include <pwd.h> #include <pwd.h>
#include <signal.h> #include <signal.h>

View File

@@ -279,7 +279,7 @@ TAILQ_HEAD(mousebinding_q, binding);
struct cmd { struct cmd {
TAILQ_ENTRY(cmd) entry; TAILQ_ENTRY(cmd) entry;
char *name; char *name;
char path[MAXPATHLEN]; char path[PATH_MAX];
}; };
TAILQ_HEAD(cmd_q, cmd); TAILQ_HEAD(cmd_q, cmd);
@@ -311,7 +311,7 @@ struct conf {
int snapdist; int snapdist;
struct gap gap; struct gap gap;
char *color[CWM_COLOR_NITEMS]; char *color[CWM_COLOR_NITEMS];
char known_hosts[MAXPATHLEN]; char known_hosts[PATH_MAX];
#define CONF_FONT "sans-serif:pixelsize=14:bold" #define CONF_FONT "sans-serif:pixelsize=14:bold"
char *font; char *font;
Cursor cursor[CF_NITEMS]; Cursor cursor[CF_NITEMS];

View File

@@ -18,12 +18,13 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <assert.h> #include <assert.h>
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

3
conf.c
View File

@@ -18,12 +18,13 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -19,12 +19,13 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <assert.h> #include <assert.h>
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -18,12 +18,13 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <dirent.h> #include <dirent.h>
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <paths.h> #include <paths.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
@@ -238,7 +239,7 @@ kbfunc_exec(struct client_ctx *cc, union arg *arg)
#define NPATHS 256 #define NPATHS 256
struct screen_ctx *sc = cc->sc; struct screen_ctx *sc = cc->sc;
char **ap, *paths[NPATHS], *path, *pathcpy; char **ap, *paths[NPATHS], *path, *pathcpy;
char tpath[MAXPATHLEN]; char tpath[PATH_MAX];
const char *label; const char *label;
DIR *dirp; DIR *dirp;
struct dirent *dp; struct dirent *dp;
@@ -323,8 +324,8 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg)
struct menu_q menuq; struct menu_q menuq;
FILE *fp; FILE *fp;
char *buf, *lbuf, *p; char *buf, *lbuf, *p;
char hostbuf[MAXHOSTNAMELEN]; char hostbuf[HOST_NAME_MAX+1];
char path[MAXPATHLEN]; char path[PATH_MAX];
int l; int l;
size_t len; size_t len;

3
menu.c
View File

@@ -19,12 +19,13 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <ctype.h> #include <ctype.h>
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -19,11 +19,12 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

19
parse.y
View File

@@ -21,7 +21,7 @@
%{ %{
#include <sys/param.h> #include <sys/types.h>
#include <sys/queue.h> #include <sys/queue.h>
#include <ctype.h> #include <ctype.h>
@@ -49,7 +49,9 @@ struct file *pushfile(const char *);
int popfile(void); int popfile(void);
int yyparse(void); int yyparse(void);
int yylex(void); int yylex(void);
int yyerror(const char *, ...); int yyerror(const char *, ...)
__attribute__((__format__ (printf, 1, 2)))
__attribute__((__nonnull__ (1)));
int kw_cmp(const void *, const void *); int kw_cmp(const void *, const void *);
int lookup(char *); int lookup(char *);
int lgetc(int); int lgetc(int);
@@ -119,21 +121,21 @@ main : FONTNAME STRING {
} }
| BORDERWIDTH NUMBER { | BORDERWIDTH NUMBER {
if ($2 < 0 || $2 > UINT_MAX) { if ($2 < 0 || $2 > UINT_MAX) {
yyerror("invalid borderwidth: %d", $2); yyerror("invalid borderwidth: %lld", $2);
YYERROR; YYERROR;
} }
conf->bwidth = $2; conf->bwidth = $2;
} }
| MOVEAMOUNT NUMBER { | MOVEAMOUNT NUMBER {
if ($2 < 0 || $2 > INT_MAX) { if ($2 < 0 || $2 > INT_MAX) {
yyerror("invalid movemount: %d", $2); yyerror("invalid movemount: %lld", $2);
YYERROR; YYERROR;
} }
conf->mamount = $2; conf->mamount = $2;
} }
| SNAPDIST NUMBER { | SNAPDIST NUMBER {
if ($2 < 0 || $2 > INT_MAX) { if ($2 < 0 || $2 > INT_MAX) {
yyerror("invalid snapdist: %d", $2); yyerror("invalid snapdist: %lld", $2);
YYERROR; YYERROR;
} }
conf->snapdist = $2; conf->snapdist = $2;
@@ -151,7 +153,7 @@ main : FONTNAME STRING {
| AUTOGROUP NUMBER STRING { | AUTOGROUP NUMBER STRING {
if ($2 < 0 || $2 > 9) { if ($2 < 0 || $2 > 9) {
free($3); free($3);
yyerror("invalid autogroup: %d", $2); yyerror("invalid autogroup: %lld", $2);
YYERROR; YYERROR;
} }
conf_autogroup(conf, $2, $3); conf_autogroup(conf, $2, $3);
@@ -176,7 +178,7 @@ main : FONTNAME STRING {
$3 < 0 || $3 > INT_MAX || $3 < 0 || $3 > INT_MAX ||
$4 < 0 || $4 > INT_MAX || $4 < 0 || $4 > INT_MAX ||
$5 < 0 || $5 > INT_MAX) { $5 < 0 || $5 > INT_MAX) {
yyerror("invalid gap: %d %d %d %d", yyerror("invalid gap: %lld %lld %lld %lld",
$2, $3, $4, $5); $2, $3, $4, $5);
YYERROR; YYERROR;
} }
@@ -438,6 +440,9 @@ yylex(void)
} else if (c == quotec) { } else if (c == quotec) {
*p = '\0'; *p = '\0';
break; break;
} else if (c == '\0') {
yyerror("syntax error");
return (findeol());
} }
if (p + 1 >= buf + sizeof(buf) - 1) { if (p + 1 >= buf + sizeof(buf) - 1) {
yyerror("string too long"); yyerror("string too long");

View File

@@ -18,11 +18,12 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -18,7 +18,7 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <assert.h> #include <assert.h>
@@ -26,6 +26,7 @@
#include <errno.h> #include <errno.h>
#include <fnmatch.h> #include <fnmatch.h>
#include <glob.h> #include <glob.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -172,7 +173,7 @@ search_print_client(struct menu *mi, int list)
static void static void
search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search, int flag) search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search, int flag)
{ {
char pattern[MAXPATHLEN]; char pattern[PATH_MAX];
glob_t g; glob_t g;
int i; int i;

3
util.c
View File

@@ -18,11 +18,12 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -24,11 +24,12 @@
* management of the xevent's. * management of the xevent's.
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -18,11 +18,12 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>

View File

@@ -18,11 +18,12 @@
* $OpenBSD$ * $OpenBSD$
*/ */
#include <sys/param.h> #include <sys/types.h>
#include "queue.h" #include "queue.h"
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>