Commits for angie
switch to files view, user index
v376_preview to v376_preview2 (2018-12-17 to 2019-01-07) v376
Show details
9cc44f3539c422b2ccca8345eb0751439450dee0 Thu Dec 20 13:52:51 2018 -0800
- Fixing mem-overwriting bug found when linefile.c has an artificially low starting buffer size for testing. Doesn't apply in normal use, just fixing so I can test lineFile's buffering logic.
bbeeeeb5d888089a025aa547c05bfc9b443dc39f Thu Dec 20 14:06:39 2018 -0800
- Adding support for files that may have a mix of newline styles (\r\n, \r, \n), enabled by calling lineFileCarefulNewlines. refs #22638
Scanning for any type of newline is not quite as efficient as scanning for only one pre-determined type, but it's necessary to deal with the kind of garbage data that has snuck into some saved sessions.
I also fixed a couple subtle cases that have not caused any trouble in our day-to-day dealings with nice \n-separated input with line sizes shorter than the default lf->buf size (64k):
* determineNlType initialized lf->nlType to UNIX, but if the first non-empty buffer did not contain any newline, UNIX may or may not have been the correct type.
* The second time determineNlType was called, it was using an outdated endIx. Note the second instance of scanning for newlines used < sizeLeft as a test instead of endIx; that needed to be applied to determineNlType too.
* determineNlType was called with buf+endIx, but with a byte limit that didn't account for endIx.
I tested lineFile with an initial buf size of 16 (in lineFileAttach) to test the looping on gotLf.
6ba4e724f84f86544c11a90f3802fd6318cd154f Fri Dec 21 16:28:42 2018 -0800
- Watch out for invalid data and unencoded newlines when reading in file uploaded as a saved session. refs #22638, #22637
cartLoadSettings did absolutely no checking that its input looked anything like cart settings, resulting in giant useless carts in which custom track files, hgTracks HTML and other arbitrary files apparently were parsed as cart settings. Now we do quite a bit of checking in cartLoadSettingsFromUserInput, and can warn the user if it looks like they are attempting to upload a custom track as a saved session.
The unencoded newlines are our fault -- since 2010, we have been writing out saved session files without encoding newlines in setting values (pasted in by the user). Then those newlines can be mistaken for the newlines that we use to separate settings. Oops! Use a heuristic that holds up so far to determine whether the newlines should have been encoded: they seem to occur in specific variables (like hgta_pastedIdentifiers), and those variables always appear in the middle of an alphabetically sorted cluster of variables with the same prefix (like hgta_).
And of course, we now write out saved session files with encoded newlines, which we decode when reading back in.
We even have to deal with carts that have mixed types of newlines from various garbage sources, using lineFileCarefulNewlines().
- src/hg/hgSession/hgSession.c - lines changed 27, context: html, text, full: html, text
switch to files view, user index