Search
j0ke.net Open Build Service
>
Projects
>
J0KE.NET
:
infrastructure
>
bash
> bash-4.0-loadables.dif
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File bash-4.0-loadables.dif of Package bash (Revision 14)
Currently displaying revision
14
,
show latest
Index: examples/loadables/Makefile.in =================================================================== --- examples/loadables/Makefile.in.orig +++ examples/loadables/Makefile.in @@ -83,7 +83,7 @@ INC = -I. -I.. -I$(topdir) -I$(topdir)/l $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $< -ALLPROG = print truefalse sleep pushd finfo logname basename dirname \ +ALLPROG = print sleep finfo logname basename dirname \ tty pathchk tee head mkdir rmdir printenv id whoami \ uname sync push ln unlink cut realpath getconf strftime mypid OTHERPROG = necho hello cat Index: examples/loadables/basename.c =================================================================== --- examples/loadables/basename.c.orig +++ examples/loadables/basename.c @@ -9,10 +9,13 @@ #endif #include <stdio.h> -#include "builtins.h" #include "shell.h" #include "common.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" +int basename_builtin (list) WORD_LIST *list; { Index: examples/loadables/cat.c =================================================================== --- examples/loadables/cat.c.orig +++ examples/loadables/cat.c @@ -25,8 +25,10 @@ #include <fcntl.h> #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #ifndef errno extern int errno; Index: examples/loadables/cut.c =================================================================== --- examples/loadables/cut.c.orig +++ examples/loadables/cut.c @@ -60,8 +60,10 @@ static const char sccsid[] = "@(#)cut.c # include <unistd.h> #endif -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #include "common.h" @@ -244,7 +246,7 @@ c_cut(fp, fname) pos = positions + 1; for (col = maxval; col; --col) { if ((ch = getc(fp)) == EOF) - return; + return (0); if (ch == '\n') break; if (*pos++) Index: examples/loadables/dirname.c =================================================================== --- examples/loadables/dirname.c.orig +++ examples/loadables/dirname.c @@ -27,10 +27,13 @@ #endif #include <stdio.h> -#include "builtins.h" #include "shell.h" #include "common.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" +int dirname_builtin (list) WORD_LIST *list; { Index: examples/loadables/finfo.c =================================================================== --- examples/loadables/finfo.c.orig +++ examples/loadables/finfo.c @@ -20,6 +20,8 @@ #include "bashansi.h" #include "shell.h" #include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "common.h" #ifndef errno @@ -81,7 +83,7 @@ int argc; char **argv; { register int i; - int mode, flags, opt; + int flags, opt; sh_optind = 0; /* XXX */ prog = base_pathname(argv[0]); @@ -174,7 +176,7 @@ int m; return (m & (S_IRWXU|S_IRWXG|S_IRWXO|S_ISUID|S_ISGID)); } -static int +static void perms(m) int m; { @@ -218,7 +220,7 @@ int m; printf ("u=%s,g=%s,o=%s", ubits, gbits, obits); } -static int +static void printmode(mode) int mode; { @@ -313,13 +315,13 @@ int flags; else printf("%ld\n", st->st_ctime); } else if (flags & OPT_DEV) - printf("%d\n", st->st_dev); + printf("%lu\n", (ulong)st->st_dev); else if (flags & OPT_INO) - printf("%d\n", st->st_ino); + printf("%lu\n", (ulong)st->st_ino); else if (flags & OPT_FID) - printf("%d:%ld\n", st->st_dev, st->st_ino); + printf("%lu:%lu\n", (ulong)st->st_dev, (ulong)st->st_ino); else if (flags & OPT_NLINK) - printf("%d\n", st->st_nlink); + printf("%lu\n", (ulong)st->st_nlink); else if (flags & OPT_LNKNAM) { #ifdef S_ISLNK b = xmalloc(4096); @@ -369,7 +371,6 @@ finfo_builtin(list) { int c, r; char **v; - WORD_LIST *l; v = make_builtin_argv (list, &c); r = finfo_main (c, v); Index: examples/loadables/getconf.c =================================================================== --- examples/loadables/getconf.c.orig +++ examples/loadables/getconf.c @@ -65,6 +65,8 @@ #include "bashansi.h" #include "shell.h" #include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "stdc.h" #include "common.h" #include "bashgetopt.h" @@ -1119,8 +1121,6 @@ static const struct conf_variable conf_t { NULL } }; -static int num_getconf_variables = sizeof(conf_table) / sizeof(struct conf_variable) - 1; - extern char *this_command_name; extern char **make_builtin_argv (); @@ -1133,8 +1133,7 @@ int getconf_builtin (list) WORD_LIST *list; { - int c, r, opt, aflag; - char **v; + int r, opt, aflag; aflag = 0; reset_internal_getopt(); @@ -1169,7 +1168,6 @@ static void getconf_help() { const struct conf_variable *cp; - register int i, column; builtin_usage(); printf("Acceptable variable names are:\n"); Index: examples/loadables/head.c =================================================================== --- examples/loadables/head.c.orig +++ examples/loadables/head.c @@ -38,6 +38,8 @@ #include "builtins.h" #include "shell.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #include "common.h" @@ -88,8 +90,10 @@ file_head (fp, cnt) break; } } + return EXECUTION_SUCCESS; } +int head_builtin (list) WORD_LIST *list; { @@ -97,8 +101,6 @@ head_builtin (list) WORD_LIST *l; FILE *fp; - char *t; - munge_list (list); /* change -num into -n num */ reset_internal_getopt (); Index: examples/loadables/hello.c =================================================================== --- examples/loadables/hello.c.orig +++ examples/loadables/hello.c @@ -11,8 +11,10 @@ #include <stdio.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" /* A builtin `xxx' is normally implemented with an `xxx_builtin' function. Index: examples/loadables/id.c =================================================================== --- examples/loadables/id.c.orig +++ examples/loadables/id.c @@ -47,6 +47,8 @@ extern struct group *getgrgid (); #include "shell.h" #include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "stdc.h" #include "common.h" #include "bashgetopt.h" @@ -64,8 +66,6 @@ static int id_flags; static uid_t ruid, euid; static gid_t rgid, egid; -static char *id_user; - static int inituser (); static int id_pruser (); Index: examples/loadables/ln.c =================================================================== --- examples/loadables/ln.c.orig +++ examples/loadables/ln.c @@ -33,8 +33,10 @@ #include <stdio.h> #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #include "common.h" @@ -50,6 +52,7 @@ typedef int unix_link_syscall_t __P((con static unix_link_syscall_t *linkfn; static int dolink (); +int ln_builtin (list) WORD_LIST *list; { Index: examples/loadables/logname.c =================================================================== --- examples/loadables/logname.c.orig +++ examples/loadables/logname.c @@ -27,8 +27,10 @@ #include <stdio.h> #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" #include "common.h" #if !defined (errno) Index: examples/loadables/mkdir.c =================================================================== --- examples/loadables/mkdir.c.orig +++ examples/loadables/mkdir.c @@ -31,8 +31,10 @@ # include <unistd.h> #endif -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #include "common.h" @@ -52,7 +54,7 @@ int mkdir_builtin (list) WORD_LIST *list; { - int opt, pflag, omode, rval, octal, nmode, parent_mode, um; + int opt, pflag, omode, rval, octal, nmode, parent_mode; char *mode; WORD_LIST *l; @@ -169,7 +171,7 @@ make_path (path, nmode, parent_mode) while (*p == '/') p++; - while (p = strchr (p, '/')) + while ((p = strchr (p, '/'))) { *p = '\0'; if (stat (npath, &sb) != 0) Index: examples/loadables/necho.c =================================================================== --- examples/loadables/necho.c.orig +++ examples/loadables/necho.c @@ -21,9 +21,15 @@ along with Bash. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include <stdio.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" necho_builtin (list) WORD_LIST *list; Index: examples/loadables/pathchk.c =================================================================== --- examples/loadables/pathchk.c.orig +++ examples/loadables/pathchk.c @@ -58,8 +58,10 @@ #include <stdio.h> #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "stdc.h" #include "bashgetopt.h" #include "maxpath.h" @@ -98,6 +100,7 @@ extern char *strerror (); static int validate_path (); +int pathchk_builtin (list) WORD_LIST *list; { @@ -278,7 +281,7 @@ validate_path (path, portability) char *path; int portability; { - int path_max; + size_t path_max; int last_elem; /* Nonzero if checking last element of path. */ int exists; /* 2 if the path element exists. */ char *slash; @@ -290,10 +293,8 @@ validate_path (path, portability) if (*path == '\0') return 0; -#ifdef lint /* Suppress `used before initialized' warning. */ exists = 0; -#endif /* Figure out the parent of the first element in PATH. */ parent = xstrdup (*path == '/' ? "/" : "."); @@ -370,7 +371,7 @@ validate_path (path, portability) free (parent); if (strlen (path) > path_max) { - builtin_error ("path `%s' has length %d; exceeds limit of %d", + builtin_error ("path `%s' has length %zu; exceeds limit of %zu", path, strlen (path), path_max); return 1; } Index: examples/loadables/print.c =================================================================== --- examples/loadables/print.c.orig +++ examples/loadables/print.c @@ -33,6 +33,8 @@ #include "bashansi.h" #include "shell.h" #include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" #include "stdc.h" #include "bashgetopt.h" #include "builtext.h" @@ -77,7 +79,7 @@ print_builtin (list) { int c, r, nflag, raw, ofd, sflag; intmax_t lfd; - char **v, *pfmt, *arg; + char *pfmt; WORD_LIST *l; nflag = raw = sflag = 0; Index: examples/loadables/printenv.c =================================================================== --- examples/loadables/printenv.c.orig +++ examples/loadables/printenv.c @@ -26,8 +26,10 @@ #include <config.h> #include <stdio.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #include "common.h" Index: examples/loadables/push.c =================================================================== --- examples/loadables/push.c.orig +++ examples/loadables/push.c @@ -25,8 +25,10 @@ #include <stdio.h> #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "jobs.h" #include "bashgetopt.h" #include "common.h" Index: examples/loadables/realpath.c =================================================================== --- examples/loadables/realpath.c.orig +++ examples/loadables/realpath.c @@ -49,8 +49,10 @@ #include <maxpath.h> #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #include "common.h" @@ -60,6 +62,7 @@ extern int errno; extern char *sh_realpath(); +int realpath_builtin(list) WORD_LIST *list; { Index: examples/loadables/rmdir.c =================================================================== --- examples/loadables/rmdir.c.orig +++ examples/loadables/rmdir.c @@ -24,14 +24,17 @@ #include <stdio.h> #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "common.h" #if !defined (errno) extern int errno; #endif +int rmdir_builtin (list) WORD_LIST *list; { Index: examples/loadables/sleep.c =================================================================== --- examples/loadables/sleep.c.orig +++ examples/loadables/sleep.c @@ -46,6 +46,8 @@ #include "shell.h" #include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "common.h" #define RETURN(x) \ Index: examples/loadables/strftime.c =================================================================== --- examples/loadables/strftime.c.orig +++ examples/loadables/strftime.c @@ -31,8 +31,10 @@ #include <stdio.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "common.h" int Index: examples/loadables/sync.c =================================================================== --- examples/loadables/sync.c.orig +++ examples/loadables/sync.c @@ -24,10 +24,13 @@ #include <unistd.h> #endif -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" +int sync_builtin (list) WORD_LIST *list; { Index: examples/loadables/tee.c =================================================================== --- examples/loadables/tee.c.orig +++ examples/loadables/tee.c @@ -38,8 +38,10 @@ #include <signal.h> #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #include "common.h" @@ -61,6 +63,7 @@ extern volatile sig_atomic_t interrupt_i extern char *strerror (); +int tee_builtin (list) WORD_LIST *list; { @@ -69,8 +72,6 @@ tee_builtin (list) FLIST *fl; char *buf, *bp; - char *t; - reset_internal_getopt (); append = nointr = 0; tee_flist = (FLIST *)NULL; Index: examples/loadables/template.c =================================================================== --- examples/loadables/template.c.orig +++ examples/loadables/template.c @@ -11,8 +11,10 @@ #include <stdio.h> #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #if !defined (errno) Index: examples/loadables/truefalse.c =================================================================== --- examples/loadables/truefalse.c.orig +++ examples/loadables/truefalse.c @@ -20,18 +20,24 @@ #include <config.h> +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include "bashtypes.h" #include "shell.h" #include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "common.h" -true_builtin (list) +int true_builtin (list) WORD_LIST *list; { return EXECUTION_SUCCESS; } -false_builtin (list) +int false_builtin (list) WORD_LIST *list; { return EXECUTION_FAILURE; Index: examples/loadables/tty.c =================================================================== --- examples/loadables/tty.c.orig +++ examples/loadables/tty.c @@ -23,13 +23,16 @@ #include "config.h" #include <stdio.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #include "common.h" extern char *ttyname (); +int tty_builtin (list) WORD_LIST *list; { Index: examples/loadables/uname.c =================================================================== --- examples/loadables/uname.c.orig +++ examples/loadables/uname.c @@ -42,8 +42,10 @@ struct utsname { #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #include "common.h" @@ -63,10 +65,11 @@ static void uprint(); static int uname_flags; +int uname_builtin (list) WORD_LIST *list; { - int opt, r; + int opt; struct utsname uninfo; uname_flags = 0; Index: examples/loadables/unlink.c =================================================================== --- examples/loadables/unlink.c.orig +++ examples/loadables/unlink.c @@ -30,14 +30,17 @@ #include <stdio.h> #include <errno.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "common.h" #ifndef errno extern int errno; #endif +int unlink_builtin (list) WORD_LIST *list; { Index: examples/loadables/whoami.c =================================================================== --- examples/loadables/whoami.c.orig +++ examples/loadables/whoami.c @@ -23,11 +23,14 @@ #include <config.h> #include <stdio.h> -#include "builtins.h" #include "shell.h" +#include "builtins.h" +#include "builtins/builtext.h" +#include "builtins/common.h" #include "bashgetopt.h" #include "common.h" +int whoami_builtin (list) WORD_LIST *list; { Index: shell.h =================================================================== --- shell.h.orig +++ shell.h @@ -22,6 +22,9 @@ #include "config.h" #endif +#include <sys/types.h> +#include <unistd.h> + #include "bashjmp.h" #include "command.h"