Re: emelfm2 0.1.0 bugs and patches

Thanks, Marcus.

As of now, in svn:
THOUSANDS_SEP >> THOUSEP
done

#include <signal.h> in e2_command.c
done

TEMP_FAILURE_RETRY macro
your version added to e2_task.h

strndup >> g_strndup
not done - truncated strdup() implemented instead
policy is to avoid glib functions unless string is guaranteed to be utf-8 
(though for a duplication, it probably doesn't matter)

getdelim()
replaced by fgets(), where input terminator is \n
replaced by fn with looping fgetc(), where input terminator is \0

mempcpy()
replaced by equivalent memcpy() arrangements

Do you want me to send you a tarball?

Regards.
Tom

On Thu, 21 Jul 2005 11:05:11 +0200
Marcus von Appen <mva@xxxxxxxxxxxx> wrote:

> Hi,
> 
> although it was nice to see, that there was a new emelfm2 version, I
> never had to fix so many bugs in it, so that it can work on *BSD
> (better read: !Linux :-).  The unfortunate usage of GNU extensions
> causes emelfm2 not to work (even not to build properly) on a system,
> which does not use the GNU libc.
> 
> I patched several issues (the patches are attached) and will give you
> a list of issues, which cannot be fixed at the moment (due to the lack
> of equivalent implementations or similar issues).
> 
> Issues:
> 
> * Usage of constant THOUSANDS_SEP. THOUSANDS_SEP is not defined in
>   POSIX, only THOUSEP is provided there. The THOUSANDS_SEP definition
>   seems to be a GNUish definition and should not be used. It causes
>   the following sources to break:
>   plugins/e2p_du.c, line 187
>   src/e2_filelist.c, line 1183
> 
>   See also the patch set.
> 
> * Constant usage of a TEMP_FAILURE_RETRY macro. It neither exists in
>   POSIX nor ANSI and causes several several sources to break:
>   src/e2_task_backend.c
>   
>   Solution: Use an own definition of TEMP_FAILURE_RETRY on demand:
>   #ifndef TEMP_FAILURE_RETRY
>   #define TEMP_FAILURE_RETRY(expr) \
>     ({ long int _res; \
>        do _res = (long int) (expr); \
>        while (_res == -1L && errno == EINTR); \
>        _res; })
>   #endif
> 
>   I added this macro definition to the e2_task_backend.c file. Maybe
>   a header would be the better place for it (see also the patch set).
> 
> * Usage of strndup and strdup call. strndup does not exist in ANSI nor
>   POSIX nor the FreeBSD libc (it has only strdup) and causes the
>   following sources
>   to break:
>   src/e2_task_backend.c, line 518, 1079ff, 1110ff (strndup, strdup)
>   
>   The following are unfixed, because it is unknown, whether the
>   variable is freed using free() or not:
>   src/config/e2_cache.c, line 235 (*str = strdup)
>   src/utils/e2_utils.c, line 379 (path = strdup)
>   src/filesystems/e2_fs_walk.c, line 284 (parked_dirs = ...)
> 
>   Solution: Use either an own implementation, a strncpy/memcpy call or
>   
>   the system independant g_strndup implementation of the glib
>   (see also the patch set).
> 
> * Usage of getdelim. getdelim does not exist in ANSI nor POSIX nor the
>   FreeBSD libc and causes the following sources to break:
>   src/dialogs/e2_file_info_dialog.c
>   src/filesystem/e2_fs.c
> 
> * Usage of mempcpy. mempcpy does not exist in ANSI nor POSIX nor the
>   FreeBSD libc and causes the following sources to break:
>   src/filesystem/e2_fs_walk.c
>   src/utils/e2_utils.c
> 
> Until the the last both issues (getdelim and mempcpy) are not fixed, I
> cannot update emelfm2 version of the FreeBSD ports or use it on a
> FreeBSD system (other BSDs/Unices might have the same problem), so a
> fix would be much appreciated.
> 
> Regards
> Marcus


-- 
Users can unsubscribe from the list by sending email to 
emelfm2-request@xxxxxxxxxxxxx with 'unsubscribe' in the subject field or by 
logging into the web interface.

Other related posts: