New answers tagged

2

Your certainly on the right track. For my projects I use: "check" to unit test all method (including as many code paths as I can - have time for). This runs super fast and gives me confidence that the parts of my application are doing what I expect. "Valgrind" to check the memory usage of the final application while running system/regression tests. This is ...


2

This is not strictly an answer to you question, but if you want to start a new project, do you really want to copy all the history, branches, etc from the old project? If you just want a working template, say to get the structure of the project as a starting point, but it should have no other ties to the original, then clone the repo but delete the .git ...


3

Copying copies the working copy, any untracked files, and any local configuration along with the actual repository. Cloning doesn't, but it sets up the origin remote with a tracking branch. Use copying if you want to duplicate your repository so that all remote operations work the same. Use cloning if you want to create a subordinate repository to your ...


6

I'm not going to debug your code, there's not enough context to do this anyway, but I'm going to show you an idiom that you will probably find easier to use correctly. As a bonus, it will also be faster. Have a look at your loop body. You are allocating memory during each iteration and free it under certain circumstances depending on the overall control ...


2

do you agree this is a good way of solving the problem? No. When you parse a shell command line, you work your way through the string, and so at any point you should already know whether you are inside quotes. Either because your parsing state machine is in some "between quotes" state, or because your recursive descent parser is in some "parse quoted ...


2

In principle, you could use something like your isBetweenQuotes function, but you're (probably) better served by a more structured way of parsing arguments pipelines. However, something like the following might work: int isBetweenQuotes(int pos, char *str) { return IBQplain(pos, str, 0); } int IBQplain(int pos, char *str, int offset) { char ch; ...



Top 50 recent answers are included