guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] gnu: libcanberra: Add propagated-input.


From: Federico Beffa
Subject: Re: [PATCH 3/4] gnu: libcanberra: Add propagated-input.
Date: Sun, 11 Jan 2015 09:34:38 +0100

On Sat, Jan 10, 2015 at 10:13 PM, Ludovic Courtès <address@hidden> wrote:
> Very good!  Could you add the story about XDG_DATA_DIRS
> vs. XDG_DATA_HOME as a comment above the phase?

Will do.

>
>> +          (let ((sounds (string-append
>> +                         (assoc-ref inputs "sound-theme-freedesktop")
>> +                         "/share")))
>> +            (substitute* "src/sound-theme-spec.c"
>> +              (("return \"/usr/local/share:/usr/share\";")
>> +               (string-append "return \"" sounds "\";\n"
>> +                              "             else {\n"
>> +                              "                const char *stp = \":"
>> +                              sounds "\";\n"
>> +                              "                size_t len =  strlen(stp) + "
>> +                              "strlen(g) + 1;\n"
>> +                              "                "
>> +                              "char *g2 = (char*) malloc(len);\n"
>> +                              "                return "
>> +                              "strcat(strcpy(g2, g), stp);\n"
>> +                              "        }")))))
>
> Why not just:
>
>   (string-append "return \"" sounds "\";")
>
> ?

The first "return" is used in an "if" clause that checks that
XDG_DATA_DIRS is either empty, or not defined.  The variable "g" is a
pointer to a string contains the value of XDG_DATA_DIRS. I'm adding an
"else" with a second "return" to add the sounds directory even when
XDG_DATA_DIRS is defined (the unpatched program does returns "g" in
this case and therefore the sounds would not be found).

Regards,
Fede



reply via email to

[Prev in Thread] Current Thread [Next in Thread]