diff options
author | ache <ache@FreeBSD.org> | 2003-08-06 08:46:21 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2003-08-06 08:46:21 +0000 |
commit | 10de01a46be3ee94ac910ffcf68ebf3b3ac31644 (patch) | |
tree | 09a7c2772da2438fe97a3a621e63e691dc4110a4 /sbin/restore | |
parent | 7da34893087a086403ecad1f03d077b2696d834c (diff) | |
download | FreeBSD-src-10de01a46be3ee94ac910ffcf68ebf3b3ac31644.zip FreeBSD-src-10de01a46be3ee94ac910ffcf68ebf3b3ac31644.tar.gz |
Localize 'ls' output
Don't set 8bit in quote processing
Diffstat (limited to 'sbin/restore')
-rw-r--r-- | sbin/restore/interactive.c | 9 | ||||
-rw-r--r-- | sbin/restore/main.c | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c index ec49c36..5fc468b 100644 --- a/sbin/restore/interactive.c +++ b/sbin/restore/interactive.c @@ -46,9 +46,10 @@ static const char rcsid[] = #include <ufs/ufs/dir.h> #include <protocols/dumprestore.h> -#include <setjmp.h> +#include <ctype.h> #include <glob.h> #include <limits.h> +#include <setjmp.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -421,7 +422,7 @@ copynext(char *input, char *output) */ quote = *cp++; while (*cp != quote && *cp != '\0') - *bp++ = *cp++ | 0200; + *bp++ = *cp++; if (*cp++ == '\0') { fprintf(stderr, "missing %c\n", quote); cp--; @@ -581,7 +582,7 @@ mkentry(char *name, struct direct *dp, struct afile *fp) fp->fnum = dp->d_ino; fp->fname = savename(dp->d_name); for (cp = fp->fname; *cp; cp++) - if (!vflag && (*cp < ' ' || *cp >= 0177)) + if (!vflag && !isprint((unsigned char)*cp)) *cp = '?'; fp->len = cp - fp->fname; if (dflag && TSTINO(fp->fnum, dumpmap) == 0) @@ -748,7 +749,7 @@ glob_stat(const char *name, struct stat *stp) static int fcmp(const void *f1, const void *f2) { - return (strcmp(((struct afile *)f1)->fname, + return (strcoll(((struct afile *)f1)->fname, ((struct afile *)f2)->fname)); } diff --git a/sbin/restore/main.c b/sbin/restore/main.c index 4fe2be6..d636880 100644 --- a/sbin/restore/main.c +++ b/sbin/restore/main.c @@ -53,6 +53,7 @@ static const char rcsid[] = #include <err.h> #include <limits.h> +#include <locale.h> #include <paths.h> #include <stdio.h> #include <stdlib.h> @@ -94,6 +95,8 @@ main(int argc, char *argv[]) if (argc < 2) usage(); + (void)setlocale(LC_ALL, ""); + if ((inputdev = getenv("TAPE")) == NULL) inputdev = _PATH_DEFTAPE; obsolete(&argc, &argv); |