~ubuntu-branches/debian/sid/alpine/sid

« back to all changes in this revision

Viewing changes to alpine/arg.c

  • Committer: Package Import Robot
  • Author(s): Unit 193
  • Date: 2015-05-01 19:52:36 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20150501195236-e2xjytpbb7ik352w
Tags: 2.20+dfsg1-1
* Imported Upstream version 2.20+dfsg1
  - Drop patches applied upstream.
  - Refresh remaining patches.
  - d/rules: Update SHA256 for alpine 2.20.
* Update Standards-Version to 3.9.6.
* d/watch: Narrow the regex to only match source tarballs.
* d/alpine-doc.docs: tech-notes.txt moved to under the tech-notes/ dir.
* d/control: Update Vcs-Browser for cgit.
* d/p/10_alpine_1.10_spooldir.patch: Fix a few more references.
* d/p/40_fix_browser_hardcoded_paths.patch:
  - Fix hardcoded paths to specific browsers.
* d/p/40_fix_tech_notes_hardcoded_paths.patch, d/rules:
  - Drop patch in favor of changing paths after the build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
/*
6
6
 * ========================================================================
 
7
 * Copyright 2013-2015 Eduardo Chappa
7
8
 * Copyright 2006-2008 University of Washington
8
 
 * Copyright 2013 Eduardo Chappa
9
9
 *
10
10
 * Licensed under the Apache License, Version 2.0 (the "License");
11
11
 * you may not use this file except in compliance with the License.
58
58
#ifdef  PASSFILE
59
59
static char args_err_missing_passfile[] =       N_("missing argument for option \"-passfile\"");
60
60
static char args_err_non_abs_passfile[] =       N_("argument to \"-passfile\" should be fully-qualified");
 
61
#ifdef SMIME
 
62
static char args_err_missing_pwdcertdir[] =     N_("missing argument for option \"-pwdcertdir\"");
 
63
static char args_err_non_abs_pwdcertdir[] =     N_("argument to \"-pwdcertdir\" should be fully-qualified");
 
64
#endif /* SMIME inside PASSFILE */
61
65
#endif
62
66
static char args_err_missing_sort[] =           N_("missing argument for option \"-sort\"");
63
67
static char args_err_missing_flag_arg[] =       N_("missing argument for flag \"%c\"");
130
134
#ifdef  PASSFILE
131
135
N_(" -passfile <fully_qualified_filename>\tSet the password file to something other"),
132
136
N_("\t\tthan the default"),
 
137
#ifdef SMIME
 
138
N_(" -pwdcertdir <fully_qualified_path>\tSet the directory to store a personal"),
 
139
N_("\t\tkey and certificate to encrypt and decrypt your password file."),
 
140
#endif /* SMIME inside PASSFILE */
133
141
#endif  /* PASSFILE */
134
142
 
135
143
#ifdef  LOCAL_PASSWD_CACHE
290
298
 
291
299
                  goto Loop;
292
300
              }
 
301
#ifdef SMIME
 
302
              else if(strcmp(*av, "pwdcertdir") == 0){
 
303
                  if(--ac){
 
304
                      if((str = *++av) != NULL){
 
305
                          if(!is_absolute_path(str)){
 
306
                              display_args_err(_(args_err_non_abs_pwdcertdir),
 
307
                                               NULL, 1);
 
308
                              ++usage;
 
309
                          }
 
310
                          else{
 
311
                              if(pine_state->pwdcertdir)
 
312
                                fs_give((void **)&pine_state->pwdcertdir);
 
313
 
 
314
                              pine_state->pwdcertdir = cpystr(str);
 
315
                          }
 
316
                      }
 
317
                  }
 
318
                  else{
 
319
                      display_args_err(_(args_err_missing_pwdcertdir), NULL, 1);
 
320
                      ++usage;
 
321
                  }
 
322
 
 
323
                  goto Loop;
 
324
              }
 
325
#endif  /* SMIME inside PASSFILE */
293
326
#endif  /* PASSFILE */
294
327
 
295
328
#ifdef  LOCAL_PASSWD_CACHE
1157
1190
    if(!arg || !arg[0])
1158
1191
      return 0;
1159
1192
 
 
1193
    if((value = strchr(arg, '=')) != NULL){
 
1194
        i = value - arg;
 
1195
        arg[i] = '\0';
 
1196
    }
 
1197
    else
 
1198
        i = -1;
 
1199
 
1160
1200
    for(v = ps_global->vars; v->name != NULL; v++){
1161
 
      if(v->is_used && struncmp(v->name, arg, strlen(v->name)) == 0){
 
1201
        if(v->is_used && strucmp(v->name, arg) == 0){
1162
1202
          p1 = arg + strlen(v->name);
 
1203
          if(i > 0) arg[i] = '=';
1163
1204
 
1164
 
          /*----- Skip to '=' -----*/
 
1205
            /*----- Skip to '=' -----*/
1165
1206
          while(*p1 && (*p1 == '\t' || *p1 == ' '))
1166
 
            p1++;
 
1207
             p1++;
1167
1208
 
1168
1209
          if(*p1 != '='){
1169
1210
              char buf[MAILTMPLEN];
1175
1216
 
1176
1217
          p1++;
1177
1218
          break;
1178
 
      }
 
1219
        }
1179
1220
    }
 
1221
        
 
1222
 
 
1223
    if(i > 0) arg[i] = '=';
1180
1224
 
1181
1225
    /* no match, check for a feature name used directly */
1182
1226
    if(v->name == NULL){