[PATCH] Better solves Bug#860

Dirk Hohndel dirk at hohndel.org
Sat Mar 21 11:17:52 PDT 2015


On Sat, Mar 21, 2015 at 04:54:40PM +0200, Lubomir I. Ivanov wrote:
> On 21 March 2015 at 16:47, Robert C. Helling
> <robert at euve10195.vserver.de> wrote:
> > I am not quite sure this is the correct logic. I would think one should append an extension only (and then always) if the file name does not contain a dot as otherwise the user has already chosen another extension explicitly.
> >
> 
> i guess so!
> this will break if the user wants an explicit extension.
> 
> >> Am 20.03.2015 um 21:40 schrieb Abhinav Agarwal <aagarwal.gtr at gmail.com>:
> >>
> >> While exporting a divelog to xml/ssrf, if given filename contains a dot it doesnt get saved as intended. for eg: if given filename is 'divelog.first' it should get saved as 'divelog.first.ssrf' but it gets saved as 'divelog.first'. This happens only on linux and not on windows. If you were to do the same on windows it would get saved as 'divelog.first.xml'. This patch solves the issue. It is syntactically better than the previous patch I submitted.
> >
> 
> could you revisit the patch?
> the idea would be to append an extension only if no extension is
> specified by the user.

The challenge that was pointed out is this.

A user decides for whatever reason to name their dive file
dives.in.palau
and expects an extension to be added as dives.in.palual.ssrf

On the other hand, a user might pick
dives-in-palau.dvs
and expect .dvs to be respected as file name extension (and therefore not
want it to turn into dives-in-palau.dvs.ssrf)

I don't think there is a way to make everyone happy.

The question is which way do we want to go?

My inclination is to say "if there's a dot in the name, don't add an
extension". I believe that's what we have right now.

/D


More information about the subsurface mailing list