unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Federico Beffa <beffa@ieee.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH 3/4] gnu: libcanberra: Add propagated-input.
Date: Sun, 11 Jan 2015 09:34:38 +0100	[thread overview]
Message-ID: <CAKrPhPOUKXOBkfOkS5ZcCSeFLm6KDn30nNrtTwyde-cb2Ti51w@mail.gmail.com> (raw)
In-Reply-To: <87fvbifiej.fsf@gnu.org>

On Sat, Jan 10, 2015 at 10:13 PM, Ludovic Courtès <ludo@gnu.org> 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	other threads:[~2015-01-11  8:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 21:14 [PATCH 3/4] gnu: libcanberra: Add propagated-input Federico Beffa
2014-12-21 11:06 ` Ludovic Courtès
2014-12-21 15:33   ` Federico Beffa
2015-01-07 17:20     ` Federico Beffa
2015-01-07 20:11     ` Ludovic Courtès
2015-01-08 17:08       ` Federico Beffa
2015-01-08 20:39         ` Ludovic Courtès
2015-01-10 11:15           ` Federico Beffa
2015-01-10 21:13             ` Ludovic Courtès
2015-01-11  8:34               ` Federico Beffa [this message]
2015-01-11 10:59                 ` Ludovic Courtès
2015-01-11 13:04                   ` Federico Beffa
2015-01-11 13:34                     ` Federico Beffa
2015-01-12  9:22                       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKrPhPOUKXOBkfOkS5ZcCSeFLm6KDn30nNrtTwyde-cb2Ti51w@mail.gmail.com \
    --to=beffa@ieee.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).