X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fdentry.c;h=39505b756c81118f5927b70ab2e7728db3cebe38;hp=beb963d2c839f96517aac79b8ad3f9259db74270;hb=597e700af87a07ec12f2bd10690954473cf1ca93;hpb=f9a65bc36b0c82a7c46feec9140129fd5110289c diff --git a/src/dentry.c b/src/dentry.c index beb963d2..39505b75 100644 --- a/src/dentry.c +++ b/src/dentry.c @@ -457,10 +457,10 @@ struct inode *wim_pathname_to_inode(WIMStruct *w, const char *path) { struct dentry *dentry; dentry = get_dentry(w, path); - if (!dentry) - return NULL; - else + if (dentry) return dentry->d_inode; + else + return NULL; } /* Returns the dentry that corresponds to the parent directory of @path, or NULL @@ -953,19 +953,19 @@ int verify_dentry(struct dentry *dentry, void *wim) { const WIMStruct *w = wim; const struct inode *inode = dentry->d_inode; - int ret = WIMLIB_ERR_INVALID_DENTRY; + int ret; if (!dentry->d_inode->verified) { ret = verify_inode(dentry->d_inode, w); if (ret != 0) - goto out; + return ret; } /* Cannot have a short name but no long name */ if (dentry->short_name_len && !dentry->file_name_len) { ERROR("Dentry `%s' has a short name but no long name", dentry->full_path_utf8); - goto out; + return WIMLIB_ERR_INVALID_DENTRY; } /* Make sure root dentry is unnamed */ @@ -973,7 +973,7 @@ int verify_dentry(struct dentry *dentry, void *wim) if (dentry->file_name_len) { ERROR("The root dentry is named `%s', but it must " "be unnamed", dentry->file_name_utf8); - goto out; + return WIMLIB_ERR_INVALID_DENTRY; } } @@ -986,9 +986,7 @@ int verify_dentry(struct dentry *dentry, void *wim) } #endif - ret = 0; -out: - return ret; + return 0; }