Subject: misc/colorls show ???? with Korean filenames
To: None <tech-pkg@NetBSD.org>
From: Kibum Han <yui@yui.pe.kr>
List: tech-pkg
Date: 03/06/2005 13:39:28
----Next_Part(Sun_Mar__6_13_39_28_2005_627)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
misc/colorls shows a isprint()-failed character as '?'. I want to see
Korean filenames, so How about adding '-w' option just like /bin/ls?
'f_nonprint = 0' would be enough for this.
And one minor thing. usage() fuction should print 'colorls' not 'ls'.
Patches attached.
- patch1 is about -w option.
- patch2 is about an usage() funtion.
----Next_Part(Sun_Mar__6_13_39_28_2005_627)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="patch-ac.diff"
Index: patches/patch-ac
===================================================================
RCS file: /cvsroot/pkgsrc/misc/colorls/patches/patch-ac,v
retrieving revision 1.3
diff -u -r1.3 patch-ac
--- patches/patch-ac 28 Dec 1998 22:13:05 -0000 1.3
+++ patches/patch-ac 6 Mar 2005 03:58:34 -0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-ac,v 1.3 1998/12/28 22:13:05 marc Exp $
+$NetBSD$
---- ls.c.orig Sat Dec 21 18:40:58 1996
-+++ ls.c Mon Dec 28 17:10:04 1998
-@@ -59,6 +59,8 @@
+--- ls.c.orig 1996-12-22 08:40:58.000000000 +0900
++++ ls.c
+@@ -59,6 +59,8 @@ static char const sccsid[] = "@(#)ls.c 8
#include <string.h>
#include <unistd.h>
#include <locale.h>
@@ -11,7 +11,7 @@
#include "ls.h"
#include "extern.h"
-@@ -94,6 +96,7 @@
+@@ -94,6 +96,7 @@ int f_statustime; /* use time of last m
int f_dirname; /* if precede with directory name */
int f_timesort; /* sort by time vice name */
int f_type; /* add type character for non-regular files */
@@ -19,19 +19,19 @@
#ifndef BSD4_4_LITE
int f_whiteout; /* show whiteout entries */
#endif
-@@ -135,9 +138,9 @@
+@@ -135,9 +138,9 @@ main(argc, argv)
fts_options = FTS_PHYSICAL;
#ifdef BSD4_4_LITE
- while ((ch = getopt(argc, argv, "1ACFLRTacdfgikloqrstu")) != EOF) {
-+ while ((ch = getopt(argc, argv, "1ACFGLRTacdfgikloqrstu")) != EOF) {
++ while ((ch = getopt(argc, argv, "1ACFGLRTacdfgikloqrstuw")) != EOF) {
#else
- while ((ch = getopt(argc, argv, "1ACFLRTWacdfgikloqrstu")) != EOF) {
-+ while ((ch = getopt(argc, argv, "1ACFGLRTWacdfgikloqrstu")) != EOF) {
++ while ((ch = getopt(argc, argv, "1ACFGLRTWacdfgikloqrstuw")) != EOF) {
#endif
switch (ch) {
/*
-@@ -168,6 +171,10 @@
+@@ -168,6 +171,10 @@ main(argc, argv)
case 'F':
f_type = 1;
break;
@@ -42,7 +42,17 @@
case 'L':
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
-@@ -228,18 +235,21 @@
+@@ -215,6 +222,9 @@ main(argc, argv)
+ case 't':
+ f_timesort = 1;
+ break;
++ case 'w':
++ f_nonprint = 0;
++ break;
+ #ifndef BSD4_4_LITE
+ case 'W':
+ f_whiteout = 1;
+@@ -228,18 +238,21 @@ main(argc, argv)
argc -= optind;
argv += optind;
@@ -66,7 +76,7 @@
fts_options |= FTS_COMFOLLOW;
#ifndef BSD4_4_LITE
-@@ -384,7 +394,8 @@
+@@ -384,7 +397,8 @@ display(p, list)
u_long btotal, maxblock, maxinode, maxlen, maxnlink;
int bcfile, flen, glen, ulen, maxflags, maxgroup, maxuser;
int entries, needstats;
----Next_Part(Sun_Mar__6_13_39_28_2005_627)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename=patch-af
$NetBSD$
--- util.c.orirg 2005-03-06 12:49:10.000000000 +0900
+++ util.c
@@ -69,9 +69,9 @@ void
usage()
{
#ifdef BSD4_4_LITE
- (void)fprintf(stderr, "usage: ls [-1ACFLRTacdfiklqrstu] [file ...]\n");
+ (void)fprintf(stderr, "usage: colorls [-1ACFGLRTacdfiklqrstuw] [file ...]\n");
#else
- (void)fprintf(stderr, "usage: ls [-1ACFLRTWacdfiklqrstu] [file ...]\n");
+ (void)fprintf(stderr, "usage: colorls [-1ACFGLRTWacdfiklqrstuw] [file ...]\n");
#endif
exit(1);
}
----Next_Part(Sun_Mar__6_13_39_28_2005_627)----