|
a/src/common/unacpp.cpp |
|
b/src/common/unacpp.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: unacpp.cpp,v 1.7 2006-01-23 13:32:28 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: unacpp.cpp,v 1.8 2006-04-04 09:36:46 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
41 |
int status;
|
41 |
int status;
|
42 |
status = dofold ?
|
42 |
status = dofold ?
|
43 |
unacfold_string(encoding, in.c_str(), in.length(), &cout, &out_len) :
|
43 |
unacfold_string(encoding, in.c_str(), in.length(), &cout, &out_len) :
|
44 |
unac_string(encoding, in.c_str(), in.length(), &cout, &out_len);
|
44 |
unac_string(encoding, in.c_str(), in.length(), &cout, &out_len);
|
45 |
if (status < 0) {
|
45 |
if (status < 0) {
|
|
|
46 |
if (cout)
|
|
|
47 |
free(cout);
|
46 |
char cerrno[20];
|
48 |
char cerrno[20];
|
47 |
sprintf(cerrno, "%d", errno);
|
49 |
sprintf(cerrno, "%d", errno);
|
48 |
out = string("unac_string failed, errno : ") + cerrno;
|
50 |
out = string("unac_string failed, errno : ") + cerrno;
|
49 |
return false;
|
51 |
return false;
|
50 |
}
|
52 |
}
|
51 |
out.assign(cout, out_len);
|
53 |
out.assign(cout, out_len);
|
|
|
54 |
if (cout)
|
52 |
free(cout);
|
55 |
free(cout);
|
53 |
return true;
|
56 |
return true;
|
54 |
}
|
57 |
}
|
55 |
|
58 |
|
56 |
#else // not testing
|
59 |
#else // not testing
|
57 |
|
60 |
|