Bug 38279

Summary: xdg-user-dirs strndup and iconv
Product: xdg-user-dirs Reporter: Markus Duft <mduft>
Component: GeneralAssignee: Alexander Larsson <alexl>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium CC: freedesktop-bugs
Version: unspecified   
Hardware: Other   
OS: Interix   
Whiteboard:
i915 platform: i915 features:
Attachments: build fix for --disable-nls/iconv in external library/strndup missing

Description Markus Duft 2011-06-14 00:44:19 UTC
Created attachment 47922 [details] [review]
build fix for --disable-nls/iconv in external library/strndup missing

attached is a small patch for xdg-user-dirs, that makes it build on platform without strndup, and with iconv in an external library (by adding $LIBICONV to the link line, which was missing). also, building without nls (--disable-nls) didn't work, as gettext stuff was unconditional...

is that patch ok for you to include upstream?
Comment 1 Alexander Larsson 2012-01-10 02:43:24 UTC
Comment on attachment 47922 [details] [review]
build fix for --disable-nls/iconv in external library/strndup missing

Review of attachment 47922 [details] [review]:
-----------------------------------------------------------------

The primary reason for having xdg-user-dirs at all is translations, why would you want to use it with nls disabled?
Would be better to just replace it with fixed files/dir in /etc/skel then.

::: xdg-user-dirs-0.14.orig/xdg-user-dirs-update.c
@@ +366,4 @@
>        paths[numfiles++] = strndup (path, len);
> +#else
> +      paths[numfiles++] = strdup (path);
> +#endif

You can't just replace strndup with strdup, they don't do the same thing. This will break the code.
Comment 2 Samuli Suominen 2013-06-27 10:42:32 UTC
(In reply to comment #1)
> The primary reason for having xdg-user-dirs at all is translations, why
> would you want to use it with nls disabled?

nod, which is why I've removed the patch attached here from Gentoo's 0.15 package again.

Markus, if you find xdg-user-dirs blocking your porting of some other packages, please contact me directly and we can discuss making it optional
As in, we should make the package optional instead trying to build part of it

i believe this bug could be closed as wontfix/invalid
Comment 3 GitLab Migration User 2018-10-15 07:55:01 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-user-dirs/issues/2.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.