}
}
- if (asRename) {
+ if (asRename != NULL) {
*asRename = duringRename;
}
*
* Side effects:
* - Deletes the originating directory
- * - In the event of a failed copy we'll leave the new directory in a state
+ * - In the event of a failed copy we'll leave the new directory in an
+ * undefined state. Calling File_DeleteDirectoryContent would be a
+ * good idea.
*
*-----------------------------------------------------------------------------
*/
ASSERT(srcName != NULL);
ASSERT(dstName != NULL);
- if (asMove) {
+ if (asMove != NULL) {
*asMove = FALSE;
}
}
if (File_Rename(srcName, dstName) == 0) {
- if (asMove) {
+ if (asMove != NULL) {
*asMove = TRUE;
}
*/
if (createdDir) {
/*
- * Check for free space on destination filesystem.
- * We only check for free space if the destination directory
- * did not exist. In this case, we will not be overwriting any existing
- * paths, so we need as much space as srcName.
+ * Check for free space on destination filesystem. We only check for
+ * free space if the destination directory did not exist. In this
+ * case, we will not be overwriting any existing paths, so we need as
+ * much space as srcName.
*/
- int64 srcSize;
- int64 freeSpace;
- srcSize = File_GetSizeEx(srcName);
- freeSpace = File_GetFreeSpace(dstName, TRUE);
+ int64 srcSize = File_GetSizeEx(srcName);
+ int64 freeSpace = File_GetFreeSpace(dstName, TRUE);
+
if (freeSpace < srcSize) {
char *spaceStr = Msg_FormatSizeInBytes(srcSize);
Msg_Append(MSGID(File.MoveTree.dst.insufficientSpace)
char *
File_GetModTimeString(const char *pathName) // IN:
{
- int64 modTime;
-
- modTime = File_GetModTime(pathName);
+ int64 modTime = File_GetModTime(pathName);
return (modTime == -1) ? NULL : TimeUtil_GetTimeFormat(modTime, TRUE, TRUE);
}
UnicodeIndex firstBS;
#endif
- ASSERT(pathName);
+ ASSERT(pathName != NULL);
firstFS = Unicode_FindSubstrInRange(pathName, startIndex, -1,
"/", 0, 1);
File_CreateDirectoryHierarchy(const char *pathName, // IN:
char **topmostCreated) // OUT/OPT:
{
- return File_CreateDirectoryHierarchyEx(pathName,
- 0777,
- topmostCreated);
+ return File_CreateDirectoryHierarchyEx(pathName, 0777, topmostCreated);
}
+
/*
*----------------------------------------------------------------------
*
sp = Util_SafeStrdup(searchPath);
tok = strtok_r(sp, FILE_SEARCHPATHTOKEN, &saveptr);
- while (tok) {
+ while (tok != NULL) {
if (File_IsFullPath(tok)) {
/* Fully Qualified Path. Use it. */
cur = Str_SafeAsprintf(NULL, "%s%s%s", tok, DIRSEPS, file);
}
done:
- if (cur) {
+ if (cur != NULL) {
found = TRUE;
if (result) {
char *fullPath = File_FullPath(path);
Bool isSubPath = TRUE;
- ASSERT(fullBase);
- ASSERT(fullPath);
- if ( fullPath == NULL
- || fullBase == NULL
- || strncmp(fullPath, fullBase, strlen(fullBase)) != 0) {
+ ASSERT(fullBase != NULL);
+ ASSERT(fullPath != NULL);
+
+ if (fullPath == NULL ||
+ fullBase == NULL ||
+ strncmp(fullPath, fullBase, strlen(fullBase)) != 0) {
isSubPath = FALSE;
}