New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement csplit #501
Comments
I am going to start working on it. ETA:
|
Going to start working on this. |
@jerzozwierz @kuzminva @thepotatocoder If that is no bother i'll give this a try. To everybody I have a question regarding the What do you think ? |
@scampi I tried it a little while ago but haven't got it to it recently. Using unsafe features while you wait for the language to come around isn't bad if it's only temporary, imo. |
There is a behaviour that is confusing me. When using a linenum-based pattern (i.e., copy up to a line number), the lines read but left-over from a previous pattern are taken into account. However, it is not the case with a regex-based pattern. GNU's csplit
Regex-based pattern followed by a linenum-based patternRead up to the line matching
Two consecutive regex-based patternsRead up to the line matching
ObservationI have the feeling that the 2nd run should work and output the same thing as the first. Looking at the gnu code it seems to be because both patterns do not start to read the input from the same line:
It feels like the regex-based pattern should start at the logical first line which seem to take into account the previous pattern's offset. Does it make sense ? |
I would suggest following the GNU behavior as we are trying to be drop-in compatible. On a side note you should not be looking at the GNU code as doing so can cause problems regarding the GPL and our more permissive license. |
Done here: |
I'll be working on this.
The text was updated successfully, but these errors were encountered: