[Top][All Lists]

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

[bug-mailutils] Const craziness.

From: Jeff Bailey
Subject: [bug-mailutils] Const craziness.
Date: Tue, 27 Jan 2004 12:08:29 -0800
User-agent: Mutt/1.5.4i

Jordi asked me to make sure that things were sane on 64bit, and I'm going
through and making sure all header files are included and stuff.

I came across this bit of silliness, that doesn't seem right, but I'm
not sure of the best solution:

const char *
url_to_string (const url_t url)
  if (url == NULL || url->name == NULL)
    return "";
  return url->name;

url0.h defines url->name as a char *.

But in _url_path_init we do:
  const char *name = url_to_string (url);

  mu_scheme_autodetect_p (name, &path);
  name = strdup (path);
  free (url->name);
  url->name = name;

I suspect those last three lines are best wrapped in a function that's
supposed to see url internals without the constness, but I want to make
sure before I touch the code.

Jeff Bailey

reply via email to

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