delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/01/02/10:44:37

From: scottk AT rimu DOT ig DOT utexas DOT edu (Scott Kempf)
Subject: case insensitive inode number patch. Is this better?
2 Jan 1997 10:44:37 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199701021635.KAA12032.cygnus.gnu-win32@rimu.ig.utexas.edu>
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Here is a questionable patch.  Win95 doesn't have any inode numbers,
so they are faked using a hash of the file's name.  This is very
creative, but not the best idea.  I don't have a better solution,
but it seems to me that the hash should not be case sensitive,
since the file system isn't.  This patch makes the inodes case
insensitive.  I'm not aware of any problem it fixes, but it does
create one:  "mv x X" now fails with "mv: `x' and `X' are the same file".
Since they are the same file, the error is somewhat reasonable.
Any ideas?

				Scott

*** cdksrc/src/winsup/syscalls.cc.orig	Mon Dec 30 17:45:27 1996
--- cdksrc/src/winsup/syscalls.cc	Tue Dec 31 14:59:29 1996
***************
*** 21,26 ****
--- 21,27 ----
  #include <fcntl.h>
  #include <pwd.h>
  #include <unistd.h>
+ #include <ctype.h>
  
  #include "winsup.h"
  
***************
*** 613,619 ****
    
    while (*name != '\0') 
      {
!       hash += *name + (*name <<17);
        hash ^= hash >> 2;
        name++;
      }
--- 614,620 ----
    
    while (*name != '\0') 
      {
!       hash += tolower (*name) + (tolower (*name) <<17);
        hash ^= hash >> 2;
        name++;
      }



----------------------------------
Scott Kempf (scottk AT ig DOT utexas DOT edu)
Running gnu-win32 beta 17.1
under Windows 95.
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019