~ubuntu-branches/ubuntu/vivid/cctools/vivid

« back to all changes in this revision

Viewing changes to s3tools/src/s3common.c

  • Committer: Package Import Robot
  • Author(s): Michael Hanke
  • Date: 2012-03-30 12:40:01 UTC
  • mfrom: (9.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120330124001-ze0lhxm5uwq2e3mo
Tags: 3.4.2-2
Added patch to handle a missing CFLAGS variable in Python's sysconfig
report (Closes: #661658).

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#include <stringtools.h>
11
11
#include <console_login.h>
12
12
#include "s3common.h"
 
13
#include "s3c_util.h"
13
14
 
14
15
 
15
16
char *userid = NULL;
48
49
 
49
50
void s3_initialize(int* argc, char** argv) {
50
51
        int i, mod, result, prompt = 0;
51
 
        char *username = NULL, *password = NULL, *configfile = NULL;
 
52
        char *username = NULL, *password = NULL, *configfile = NULL, *endpoint = NULL;
52
53
        char **argv2;
53
54
 
54
55
        for(i = 0; i < *argc; i++) {
55
56
                if(argv[i][0] == '-') {
56
57
                        switch(argv[i][1]) {
 
58
                                case 'e':
 
59
                                        endpoint = argv[i+1];
 
60
                                        i++;
 
61
                                        break;
57
62
                                case 'u':
58
63
                                        if(username) free(username);
59
64
                                        username = argv[i+1];
128
133
                fprintf(stderr, "Error: no username or password specified\n");
129
134
                exit(result);
130
135
        }
 
136
        
 
137
        if(endpoint || (endpoint = getenv("S3_ENDPOINT"))) {
 
138
                s3_set_endpoint(endpoint);
 
139
        }
131
140
}
132
141
 
133
142