Skip to content

Commit

Permalink
Merge branch 'fix-retweet' of https://github.com/agimenez/bti into ag…
Browse files Browse the repository at this point in the history
…imenez-fix-retweet
  • Loading branch information
gregkh committed Feb 18, 2011
2 parents d77d22d + 3773da8 commit 83a2cb0
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions bti.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 83a2cb0

Please sign in to comment.