Changeset 93 for trunk/src/sh_hash.c


Ignore:
Timestamp:
Feb 26, 2007, 10:48:51 PM (18 years ago)
Author:
rainer
Message:

Add check for PCI ROMs; fix ticket #51 (symlinks in root directory reported with leading double slash).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_hash.c

    r77 r93  
    19261926 ******************************************************************/
    19271927
    1928 static char * sh_hash_charhex( unsigned char i )
    1929 {
    1930   static char i2h[2];
    1931   int j, k;
    1932 
    1933   j = i / 16;
    1934   k = i - (j*16);
    1935 
    1936   if (j < 10) i2h[0] = '0'+j;
    1937   else        i2h[0] = 'A'+(j-10);
    1938  
    1939   if (k < 10) i2h[1] = '0'+k;
    1940   else        i2h[1] = 'A'+(k-10);
    1941 
    1942   return i2h;
    1943 }
    1944 
    19451928void sh_hash_push2db (char * key, unsigned long val1,
    19461929                      unsigned long val2, unsigned long val3,
     
    19751958      for (i = 0; i < size; ++i)
    19761959        {
    1977           p = sh_hash_charhex (str[i]);
     1960          p = sh_util_charhex (str[i]);
    19781961          tmpFile.linkpath[2*i]   = p[0];
    19791962          tmpFile.linkpath[2*i+1] = p[1];
     
    19831966  else
    19841967    {
    1985       tmpFile.c_mode[0] = '-'; 
    1986       tmpFile.c_mode[1] = '-'; tmpFile.c_mode[2]  = '-';
    1987       tmpFile.c_mode[3] = '-'; tmpFile.c_mode[4]  = '-';
    1988       tmpFile.c_mode[5] = '-'; tmpFile.c_mode[6]  = '-';
    1989       tmpFile.c_mode[7] = '-'; tmpFile.c_mode[8]  = '-';
    1990       tmpFile.c_mode[9] = '-'; tmpFile.c_mode[10] = '\0';
    1991       tmpFile.linkpath[0] = '-'; tmpFile.linkpath[1] = '\0';
     1968      for (i = 0; i < 10; ++i)
     1969        tmpFile.c_mode[i] = '-';
     1970      tmpFile.c_mode[10] = '\0';
     1971      tmpFile.linkpath[0] = '-';
     1972      tmpFile.linkpath[1] = '\0';
    19921973    }
    19931974
    19941975  if (sh.flag.checkSum == SH_CHECK_CHECK &&
    19951976      sh.flag.update == S_TRUE)
    1996     sh_hash_pushdata_memory (&tmpFile,
    1997                              _("000000000000000000000000000000000000000000000000"));
    1998   else
    1999     sh_hash_pushdata (&tmpFile,
    2000                       _("000000000000000000000000000000000000000000000000"));
     1977    sh_hash_pushdata_memory (&tmpFile, SH_KEY_NULL);
     1978  else
     1979    sh_hash_pushdata (&tmpFile, SH_KEY_NULL);
    20011980
    20021981  return;
     
    20181997  if (0 == sh_hash_get_it (key, &tmpFile))
    20191998    {
    2020       *val1  = tmpFile.size;
     1999      *val1 = tmpFile.size;
    20212000      *val2 = tmpFile.mtime;
    20222001      *val3 = tmpFile.ctime;
     
    27012680          maxcomp = KEY_LEN;
    27022681        }
    2703 
    2704     if ( sl_strncmp (linkHash, p->linkpath, maxcomp) != 0 &&
    2705          (theFile->check_mask & MODI_LNK) != 0)
    2706       {
    2707         modi_mask |= MODI_LNK;
    2708         change_code[1] = 'L';
    2709         TPT ((0, FIL__, __LINE__, _("mod=<link>")));
    2710       }
     2682     
     2683
     2684      if ( sl_strncmp (linkHash, p->linkpath, maxcomp) != 0 &&
     2685           (theFile->check_mask & MODI_LNK) != 0)
     2686        {
     2687          modi_mask |= MODI_LNK;
     2688          change_code[1] = 'L';
     2689          TPT ((0, FIL__, __LINE__, _("mod=<link>")));
     2690        }
    27112691    }
    27122692
Note: See TracChangeset for help on using the changeset viewer.