Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix retweet #10

Merged
1 commit merged into from

2 participants

@agimenez

Hi Greg,

Please pull some changes that fix the --retweet command line option behavior.

Thanks,
L. Alberto Giménez

@agimenez agimenez Fix retweet batch operation
The --retweet ID arguments were not handled properly, and bti asked all the time
for an ID. Now bti handles properly the ID passed by parameter on the
command-line.

Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
3773da8
@gregkh
Owner

pulled and pushed out, thanks.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 17, 2011
  1. @agimenez

    Fix retweet batch operation

    agimenez authored
    The --retweet ID arguments were not handled properly, and bti asked all the time
    for an ID. Now bti handles properly the ID passed by parameter on the
    command-line.
    
    Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 8 deletions.
  1. +11 −8 bti.c
View
19 bti.c
@@ -1119,7 +1119,6 @@ int main(int argc, char *argv[], char *envp[])
struct session *session;
pid_t child;
char *tweet;
- char *retweet;
static char password[80];
int retval = 0;
int option;
@@ -1161,7 +1160,7 @@ int main(int argc, char *argv[], char *envp[])
while (1) {
option = getopt_long_only(argc, argv,
- "dp:P:H:a:A:u:c:hg:G:sr:nVv",
+ "dp:P:H:a:A:u:c:hg:G:sr:nVvw:",
options, NULL);
if (option == -1)
break;
@@ -1360,17 +1359,21 @@ int main(int argc, char *argv[], char *envp[])
}
if (session->action == ACTION_RETWEET) {
- fprintf(stdout, "Status ID to retweet: ");
- retweet = get_string_from_stdin();
+ if (!session->retweet) {
+ char *rtid;
+
+ fprintf(stdout, "Status ID to retweet: ");
+ rtid = get_string_from_stdin();
+ session->retweet = zalloc(strlen(rtid) + 10);
+ sprintf(session->retweet,"%s", rtid);
+ free(rtid);
+ }
- if (!retweet || strlen(retweet) == 0) {
+ if (!session->retweet || strlen(session->retweet) == 0) {
dbg("no retweet?\n");
return -1;
}
- session->retweet = zalloc(strlen(retweet) + 10);
- sprintf(session->retweet,"%s", retweet);
- free(retweet);
dbg("retweet ID = %s\n", session->retweet);
}
Something went wrong with that request. Please try again.