1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

Oops, Ben is quite right about the rather appalling design of

filename_from_str. Here's a better fix, with some const
repercussions too.

[originally from svn r2768]
This commit is contained in:
Simon Tatham
2003-02-01 17:24:27 +00:00
parent 947b70006e
commit bd16b29a7a
12 changed files with 30 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $Id: mac.c,v 1.39 2003/02/01 15:44:08 ben Exp $ */
/* $Id: mac.c,v 1.40 2003/02/01 17:24:26 simon Exp $ */
/*
* Copyright (c) 1999 Ben Harris
* All rights reserved.
@ -801,7 +801,7 @@ void platform_get_x11_auth(char *display, int *proto,
/* SGT: I have no idea whether Mac X servers need anything here. */
}
Filename filename_from_str(char *str)
Filename filename_from_str(const char *str)
{
Filename ret;
strncpy(ret.path, str, sizeof(ret.path));
@ -809,11 +809,9 @@ Filename filename_from_str(char *str)
return ret;
}
char *filename_to_str(Filename fn)
const char *filename_to_str(const Filename *fn)
{
/* FIXME: Memory leak! */
return dupstr(fn.path);
return fn->path;
}
int filename_equal(Filename f1, Filename f2)