Am Sonntag, 18. Februar 2007 14:24 schrieb Martin Preuss:
> > This particular separator mixup that I've reported could (IMHO) be fixed
> > by the attached patch (the macro GWEN_DIR_SEPARATOR as a character was
> > introduced by me in gwenhywfarapi.h a few revisions ago). Does that seem
> > ok to you?
>
> Hmm, we always use "/" for paths (e.g. for GWEN_DB paths), I don't think we
> should change that...
>
> Since the path stuff is used widely we shouldn't introduce these changes
> there.
This particular function GWEN_Path_Convert and GWEN_Path_Append in *all* of
gwenhywfar and aqbanking and libchipcard is *only* used in aqhbci's
msglayer/hbci.c. Other functions of GWEN_Path might be used a lot more, but
they would not be affected by this change in GWEN_Path_Append. Am I wrong
here? If not, I suggest we should change the hard-coded path separator in
this particular function GWEN_Path_Append. All the rest of GWEN_Path is not
affected.
But again, this doesn't solve the "C:" escaping issue, which is much more
important. So about the C: escaping:
> I think it would be better if we somewhat caught the case where a string
> starts with "x:". I still don't see where this conversion takes place for
> the string we found in AqHBCI, but I didn't look into it...
First of all I think the erroneous escaping happens in AH_HBCI_SaveSettings,
when called from AH_HBCI_SaveMessage, where the full "path" is run through
GWEN_Path_Convert at aqhbci/plugin/msglayer/hbci.c:874. As a solution, I
think this can be solved by testing for path[1]==':' and if so, exclude the
first two letters from escaping. Suggested patch is attached. Does that sound
good to you?
Christian
Index: src/plugins/backends/aqhbci/plugin/msglayer/hbci.c
===================================================================
--- src/plugins/backends/aqhbci/plugin/msglayer/hbci.c (Revision 1178)
+++ src/plugins/backends/aqhbci/plugin/msglayer/hbci.c (Arbeitskopie)
@@ -871,7 +871,16 @@
/* escape path */
nbuf=GWEN_Buffer_new(0, 64, 0, 1);
- if (GWEN_Path_Convert(path, nbuf,
+ {
+ const char *actualpath;
+ if (strlen(path) > 2 && path[1] == ':') {
+ actualpath = path+2;
+ GWEN_Buffer_AppendByte(nbuf, path[0]);
+ GWEN_Buffer_AppendByte(nbuf, path[1]);
+ } else {
+ actualpath = path;
+ }
+ if (GWEN_Path_Convert(actualpath, nbuf,
GWEN_PATH_FLAGS_CHECKROOT |
GWEN_PATH_FLAGS_ESCAPE |
GWEN_PATH_FLAGS_TOLERANT_ESCAPE |
@@ -879,6 +888,7 @@
GWEN_Buffer_free(nbuf);
return -1;
}
+ }
/* write file */
if (GWEN_DB_WriteFile(db,
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Aqbanking-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aqbanking-devel