[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new module: relpath
From: |
Akim Demaille |
Subject: |
Re: new module: relpath |
Date: |
Tue, 19 Jun 2012 14:15:19 +0200 |
Le 18 juin 2012 à 18:31, Eli Zaretskii a écrit :
>> No, canonicalize_filename_mode is GPL because it calls xalloc() and dies
>> rather than return NULL.
>
> Maybe I'm looking at the wrong source file in gnulib. but I see these
> at the beginning of canonicalize_filename_mode:
>
> if (name == NULL)
> {
> errno = EINVAL;
> return NULL;
> }
>
> if (name[0] == '\0')
> {
> errno = ENOENT;
> return NULL;
> }
>
> if (name[0] != '/')
> {
> rname = xgetcwd ();
> if (!rname)
> return NULL;
No, you are looking at the right file, but not the right place.
/* Return true if we've already seen the triple, <FILENAME, dev, ino>.
If *HT is not initialized, initialize it. */
static bool
seen_triple (Hash_table **ht, char const *filename, struct stat const *st)
{
if (*ht == NULL)
{
size_t initial_capacity = 7;
*ht = hash_initialize (initial_capacity,
NULL,
triple_hash,
triple_compare_ino_str,
triple_free);
if (*ht == NULL)
xalloc_die ();
}
if (seen_file (*ht, filename, st))
return true;
record_file (*ht, filename, st);
return false;
}
Not to mention xgetcwd for instance.
Frankly, I am pretty lost now. Does it make sense at all to
apply the changes I made to hoist xalloc.h out of relpath,
given that anyway it sits on top on non library-ready
modules? They make the code more complex for no good reason.
Re: new module: relpath, Eli Zaretskii, 2012/06/18
- Re: new module: relpath, Eric Blake, 2012/06/18
- Re: new module: relpath, Eli Zaretskii, 2012/06/18
- Re: new module: relpath,
Akim Demaille <=
- Re: new module: relpath, Eli Zaretskii, 2012/06/19
- Re: new module: relpath, Akim Demaille, 2012/06/22
- Re: new module: relpath, Eric Blake, 2012/06/22
- Re: new module: relpath, Jim Meyering, 2012/06/22