rh

Check-in [8e4aa40c5f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Tighten up code. Treat embedded spaces in filenames as a graphic char; don't map it into '?'.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:8e4aa40c5fdaa34281eea3534300263be3ce31de46a4dfb834287bb6cbca2c8d
User & Date: ajv-899-334-8894@vsta.org 2009-11-23 04:04:46
Context
2010-04-22
03:02
Get rid of deprecated sys_nerr/sys_errlist check-in: 9802a7a9b5 user: ajv-899-334-8894@vsta.org tags: master, trunk
2009-11-23
04:04
Tighten up code. Treat embedded spaces in filenames as a graphic char; don't map it into '?'. check-in: 8e4aa40c5f user: ajv-899-334-8894@vsta.org tags: master, trunk
04:04
Turn on optimizer check-in: 770b29d768 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to rhdir.c.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
 *
 * Global Functions: ftrw, graphic, printentry, printformat
 *
 * Static Functions: fwt1, handle_file, ls_date
 */

#if !defined(lint)
static char rcsid[] = "$Id: rhdir.c,v 1.1 2008/12/27 00:56:03 vandys Exp vandys $";
#endif

#include <ctype.h>
#include "rh.h"
#include "rhdata.h"
#include "errmsg.h"
#include "sysinfo.h"
................................................................................
 *	replaced with '?'.
 */

char *graphic(const char *name)
{
    static char new_name[MAXPATHLEN + 1];
    
    char *p = new_name;
    
    while (*name != '\0') {
	if (isascii(*name) && isgraph(*name))
	    *p++ = *name++;
	else {
	    *p++ = '?';
	    name++;
	}
    }
    *p = '\0';
    return new_name;
}
 
/*







|







 







|

|
|
|
|

<







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
69
70
71
72
73
74
75
76
77
78
79
80
81
82

83
84
85
86
87
88
89
 *
 * Global Functions: ftrw, graphic, printentry, printformat
 *
 * Static Functions: fwt1, handle_file, ls_date
 */

#if !defined(lint)
static char rcsid[] = "$Id: rhdir.c,v 1.2 2009/10/02 15:28:48 vandys Exp vandys $";
#endif

#include <ctype.h>
#include "rh.h"
#include "rhdata.h"
#include "errmsg.h"
#include "sysinfo.h"
................................................................................
 *	replaced with '?'.
 */

char *graphic(const char *name)
{
    static char new_name[MAXPATHLEN + 1];
    
    char c, *p = new_name;
    
    while ((c = *name++) != '\0') {
	if ((c == ' ') || (isascii(c) && isgraph(c))) {
	    *p++ = c;
	} else {
	    *p++ = '?';

	}
    }
    *p = '\0';
    return new_name;
}
 
/*