From: Keith M. <kei...@us...> - 2008-03-18 20:54:04
|
Update of /cvsroot/mingw/man/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8702/src Modified Files: compat.h man.c manfile.c manfile.h Log Message: Clean up DO_WIN32 file system specific processing ugliness. Index: man.c =================================================================== RCS file: /cvsroot/mingw/man/src/man.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** man.c 1 Aug 2007 16:27:54 -0000 1.7 --- man.c 18 Mar 2008 20:53:47 -0000 1.8 *************** *** 100,104 **** char *dohp = 0; int do_irix; - int do_win32; int apropos; int whatis; --- 100,103 ---- *************** *** 1103,1108 **** if (do_irix) flags |= DO_IRIX; - if (do_win32) - flags |= DO_WIN32; mp = manfile(name, section, flags, section_list, mandirlist, --- 1102,1105 ---- *************** *** 1325,1340 **** do_irix = 1; - #if defined(_WIN32) || defined(__CYGWIN__) - /* - * These run on an OS with a Microsoft file system, - * which does not allow ':' in file names, other than as - * the separator following a device designator; set a flag - * so to remind us to handle this nuisance. - * - * FIXME: this should be handled in `compat.h' - */ - do_win32 = 1; - #endif - progname = mkprogname (argv[0]); --- 1322,1325 ---- Index: compat.h =================================================================== RCS file: /cvsroot/mingw/man/src/compat.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** compat.h 25 Feb 2008 22:23:08 -0000 1.7 --- compat.h 18 Mar 2008 20:53:47 -0000 1.8 *************** *** 59,62 **** --- 59,67 ---- */ # define __GNU_LIBRARY__ + + /* Cygwin also requires us to honour the file naming conventions + * of the Win32 file system. + */ + #define HAVE_WIN32_FILE_SYSTEM 1 #endif *************** *** 69,73 **** * ------------------------ * ! * Silently correct the misdemeanours of Win32, and its * "dyed in the wool" users who refuse to believe that it is ok * to use "/" instead of "\" in path names; however, we must --- 74,82 ---- * ------------------------ * ! * Here, we must also honour the Win32 file system conventions. ! */ ! #define HAVE_WIN32_FILE_SYSTEM 1 ! ! /* Silently correct the misdemeanours of Win32, and its * "dyed in the wool" users who refuse to believe that it is ok * to use "/" instead of "\" in path names; however, we must *************** *** 145,147 **** --- 154,167 ---- #endif /* !_WIN32 */ + #ifndef HAVE_WIN32_FILE_SYSTEM + /* + * The code base will use this as a flag, to indicate when + * Win32 file system semantics prevail; if we didn't set this + * above, to indicate that such a file system is present, then + * we must ensure that it is a valid symbol, resolving as a + * `false' status flag. + */ + #define HAVE_WIN32_FILE_SYSTEM 0 + #endif + #endif /* COMPAT_H */ Index: manfile.h =================================================================== RCS file: /cvsroot/mingw/man/src/manfile.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** manfile.h 18 Aug 2005 14:44:37 -0000 1.1.1.2 --- manfile.h 18 Mar 2008 20:53:48 -0000 1.2 *************** *** 28,34 **** #define DO_SUN 0x0800 /* unused today */ - /* NTFS cannot handle : in filenames */ - #define DO_WIN32 0x1000 /* turn :: into ? */ - extern struct manpage * manfile(const char *name, const char *section, int flags, --- 28,31 ---- Index: manfile.c =================================================================== RCS file: /cvsroot/mingw/man/src/manfile.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -C2 -d -r1.1.1.2 -r1.2 *** manfile.c 18 Aug 2005 14:44:36 -0000 1.1.1.2 --- manfile.c 18 Mar 2008 20:53:48 -0000 1.2 *************** *** 4,7 **** --- 4,9 ---- * Used both by man and man2html - be careful with printing! */ + #include "compat.h" + #include <stdlib.h> #include <stdio.h> *************** *** 305,309 **** to_cat_filename = tocat; ! if (name && (flags & DO_WIN32)) { /* Convert : sequences to a ? */ char *n = my_malloc(strlen(name) + 1); const char *p = name; --- 307,325 ---- to_cat_filename = tocat; ! /* Anomalously, Perl wants to uses `::' sequences within its ! * manpage names; on Win32 this isn't allowed, so the manpage ! * names have to be changed to conform to the file system's ! * accepted naming conventions. We will still allow users ! * to request pages using the Perl conventions, and we map ! * the name to the prevailing file system convention. ! */ ! if (HAVE_WIN32_FILE_SYSTEM && name) { ! /* ! * If we do have a Win32 file system, then this block ! * of code will convert `::' sequences to `?'; otherwise, ! * HAVE_WIN32_FILE_SYSTEM will be the manifest constant ! * zero, so the compiler can optimise this dead block ! * of code away. ! */ char *n = my_malloc(strlen(name) + 1); const char *p = name; |