|
2 | 2 | * mendeleyBibFix - correct formatting of bib-files that are automatically
|
3 | 3 | * generated by Mendeley Desktop
|
4 | 4 | *
|
5 |
| - * NOTE: Mendeley Desktop is copyright 2009-2013 by Mendeley Ltd. |
| 5 | + * NOTE: Mendeley Desktop is copyright 2008-2016 by Mendeley Ltd. |
6 | 6 | * This software is not provided by Mendeley and the author has no affiliation
|
7 | 7 | * with their company.
|
8 | 8 | *
|
|
20 | 20 | * - removes braces around months
|
21 | 21 | *
|
22 | 22 | * It should work correctly for files generated by Mendeley Desktop v1.16.1.
|
| 23 | + * Still functioning as of v1.17.8. |
23 | 24 | *
|
24 | 25 | * A number of fixes are hard-coded, i.e., it expects to know where the braces are.
|
25 | 26 | * So this code runs very fast (bib files with hundreds of entries are fixed in a
|
|
41 | 42 | * Distributed under the New BSD license. See LICENSE.txt for license details.
|
42 | 43 | *
|
43 | 44 | * Created June 15, 2016
|
44 |
| - * Current version v1.1 (2016-10-26) |
| 45 | + * Current version v1.2 (2017-03-17) |
45 | 46 | *
|
46 | 47 | * Revision history:
|
47 | 48 | *
|
| 49 | + * Revision v1.2 (2017-03-17) |
| 50 | + * - added removal of "file" field, which lists location of local soft copy |
| 51 | + * |
48 | 52 | * Revision v1.1 (2016-10-26)
|
49 | 53 | * - added removal of "annote" field, which includes personal annotations
|
50 | 54 | *
|
@@ -300,7 +304,14 @@ int main(int argc, char *argv[])
|
300 | 304 | memmove(&curBibEntry[curBibInd+1], &curBibEntry[indEOL+1],
|
301 | 305 | curBibLength - indEOL + 1);
|
302 | 306 | curBibLength -= indEOL - curBibInd;
|
303 |
| - curBibInd--; // Correct index so that line after URL is read correctly |
| 307 | + curBibInd--; // Correct index so that line after annote is read correctly |
| 308 | + } else if(!strncmp(&curBibEntry[curBibInd+1], "file =",6)) |
| 309 | + { // Entry has a filename. Erase the whole field |
| 310 | + indEOL = findEndOfField(curBibEntry, curBibInd+1); |
| 311 | + memmove(&curBibEntry[curBibInd+1], &curBibEntry[indEOL+1], |
| 312 | + curBibLength - indEOL + 1); |
| 313 | + curBibLength -= indEOL - curBibInd; |
| 314 | + curBibInd--; // Correct index so that line after filename is read correctly |
304 | 315 | }else if(!bUrlException
|
305 | 316 | && !strncmp(&curBibEntry[curBibInd+1], "url =",5))
|
306 | 317 | { // Entry has a URL but it should be removed. Erase the whole line
|
|
0 commit comments