mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 21:13:52 +00:00
[CDMAKE]
- llmosrt.c --> llmsort.c as it should be named. - Remove useless free(...) calls and a temp variable. svn path=/trunk/; revision=66080
This commit is contained in:
parent
44613092ba
commit
ea6251ad97
4 changed files with 4 additions and 7 deletions
|
@ -1,2 +1,2 @@
|
|||
|
||||
add_executable(cdmake cdmake.c dirhash.c llmosrt.c)
|
||||
add_executable(cdmake cdmake.c dirhash.c llmsort.c)
|
||||
|
|
|
@ -653,7 +653,7 @@ new_directory_record(struct _finddata_t *f,
|
|||
{
|
||||
PDIR_RECORD d;
|
||||
|
||||
d = calloc(1, sizeof(DIR_RECORD));
|
||||
d = calloc(1, sizeof(*d));
|
||||
if (d == NULL)
|
||||
error_exit("Insufficient memory");
|
||||
d->next_in_memory = root.next_in_memory;
|
||||
|
@ -687,7 +687,7 @@ new_directory_record(struct dirent *entry,
|
|||
char *n;
|
||||
*/
|
||||
|
||||
d = calloc(1, sizeof(DIR_RECORD));
|
||||
d = calloc(1, sizeof(*d));
|
||||
if (d == NULL)
|
||||
error_exit("Insufficient memory");
|
||||
d->next_in_memory = root.next_in_memory;
|
||||
|
|
|
@ -39,7 +39,6 @@ chop_dirname(const char *name, char **dirname)
|
|||
last_slash = strrchr(name, '\\');
|
||||
if (!last_slash)
|
||||
{
|
||||
free(*dirname);
|
||||
*dirname = malloc(1);
|
||||
**dirname = 0;
|
||||
}
|
||||
|
@ -48,7 +47,6 @@ chop_dirname(const char *name, char **dirname)
|
|||
char *newdata = malloc(last_slash - name + 1);
|
||||
memcpy(newdata, name, last_slash - name);
|
||||
newdata[last_slash - name] = 0;
|
||||
free(*dirname);
|
||||
*dirname = newdata;
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +155,6 @@ void dir_hash_add_file(struct target_dir_hash *dh, const char *source, const cha
|
|||
{
|
||||
struct target_file *tf;
|
||||
struct target_dir_entry *de;
|
||||
const char *filename = chop_filename(target);
|
||||
char *targetdir = NULL;
|
||||
char *targetnorm;
|
||||
chop_dirname(target, &targetdir);
|
||||
|
@ -170,7 +167,7 @@ void dir_hash_add_file(struct target_dir_hash *dh, const char *source, const cha
|
|||
tf->next = de->head;
|
||||
de->head = tf;
|
||||
tf->source_name = strdup(source);
|
||||
tf->target_name = strdup(filename);
|
||||
tf->target_name = strdup(chop_filename(target));
|
||||
}
|
||||
|
||||
static struct target_dir_entry *
|
||||
|
|
Loading…
Reference in a new issue