X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Ffile-name.c;h=91229595924c7bfe7fe11d1486970ae598950f5c;hb=11ff86cb02ecfe1895873e524a216266ccd3c2eb;hp=642947cbc5e8e30c7da153b83400a3fe824685e9;hpb=10ac8c99bd7a4155216e9bc3e48dd30e63b11642;p=pspp-builds.git diff --git a/src/data/file-name.c b/src/data/file-name.c index 642947cb..91229595 100644 --- a/src/data/file-name.c +++ b/src/data/file-name.c @@ -448,9 +448,9 @@ fn_compare_file_identities (const struct file_identity *a, unsigned int fn_hash_identity (const struct file_identity *identity) { - unsigned int hash = identity->device ^ identity->inode; + unsigned int hash = hash_int (identity->device, identity->inode); if (identity->name != NULL) - hash ^= hsh_hash_string (identity->name); + hash = hash_string (identity->name, hash); return hash; } @@ -476,7 +476,6 @@ default_output_path (void) const char *home_drive = getenv ("HOMEDRIVE"); const char *home_path = getenv ("HOMEPATH"); - if (home_drive != NULL && home_path != NULL) home_dir = xasprintf ("%s%s", home_drive, home_path); @@ -489,12 +488,11 @@ default_output_path (void) only if there isn't already one there, because Windows treats // specially. */ if (home_dir[0] == '\0' - || strchr ("/\\", home_dir[strlen (home_dir) - 1]) != NULL) + || strchr ("/\\", home_dir[strlen (home_dir) - 1]) == NULL) path = xasprintf ("%s%c", home_dir, '/'); else path = xstrdup (home_dir); - for(i = 0; i < strlen (path); i++) if (path[i] == '\\') path[i] = '/'; }