Cotix / cReddit

CLI Reddit client written in C. Oh, crossplatform too!
Other
96 stars 14 forks source link

Just a simple check for "/r/" in front of the subreddit passed by the user #29

Closed rslabbert closed 11 years ago

rslabbert commented 11 years ago

Checks for /r/ in front of subreddit and if not it prepends it.

Also my autoformat thingy just changed a lot of the indenting and stuff. No biggy.

mkilgore commented 11 years ago

I like the addition for the most part, any reason for all the other changes though? The actual new code is just two functions and a few extra lines in main(), those extra commits and format changes may make some messy merge issues down the line (And makes main.c not match the style I used in libreddit, I tried to make sure everything matched style used.) Also, a quick check for '/', which is valid for the front page is a good idea. There might be a few other edge cases like that, that I'm not aware of, so it'd be worth looking into.

I just made a branch on my fork here. I took your main changes from your forth commit and modified them slightly to work for the case '/' (And changed prepend to not allocate any new memory, just to avoid possible memory leaks with it's usage.). I'm happy to do whatever you'd like with the code (you can just pull it from my repo if you want to use it).

rslabbert commented 11 years ago

All those were previous commits that hadn't been submitted to the main branch yet. Most of them were then removed in the later commits. I am not entirely masterful of git as is apparent. The format changes I should be able to fix by just configuring the vim-plugin right. I'll see. Be aware those two functions I took directly from the old reddit.c, which checked for validation.

I'll close this issue and you can just push that into the reddit-api branch if you like.

mkilgore commented 11 years ago

Git can be weird, I wouldn't worry about it to much. I'll send in a pull request for my branch then.