~ubuntu-branches/debian/stretch/alpine/stretch

« back to all changes in this revision

Viewing changes to alpine/osdep/termout.gen.c

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2008-09-23 12:17:56 UTC
  • mfrom: (2.1.8 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080923121756-6u4x8bwq89qlzt32
Tags: 2.00+dfsg-2
Update to package description: note that Alpine is no longer in
alpha. (Closes: #499640)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#if !defined(lint) && !defined(DOS)
2
 
static char rcsid[] = "$Id: termout.gen.c 745 2007-10-11 18:03:32Z hubert@u.washington.edu $";
 
2
static char rcsid[] = "$Id: termout.gen.c 971 2008-03-18 17:24:31Z hubert@u.washington.edu $";
3
3
#endif
4
4
 
5
5
/*
6
6
 * ========================================================================
7
 
 * Copyright 2006-2007 University of Washington
 
7
 * Copyright 2006-2008 University of Washington
8
8
 *
9
9
 * Licensed under the Apache License, Version 2.0 (the "License");
10
10
 * you may not use this file except in compliance with the License.
32
32
#include "../../pith/filter.h"
33
33
#include "../../pith/handle.h"
34
34
#include "../../pith/conf.h"
 
35
#include "../../pith/mimedesc.h"
35
36
 
36
37
#include "../../pico/estruct.h"
37
38
#include "../../pico/pico.h"
270
271
            }
271
272
 
272
273
            if(!set_mime_extension_by_type(ext, mtype)){
273
 
                char *namep, *dotp, *p;
274
 
 
275
 
                if(namep = rfc2231_get_param(h->h.attach->body->parameter,
276
 
                                             "name", NULL, NULL)){
277
 
                    for(dotp = NULL, p = namep; *p; p++)
278
 
                      if(*p == '.')
279
 
                        dotp = p + 1;
280
 
 
281
 
                    if(dotp && strlen(dotp) < sizeof(ext) - 1){
282
 
                        strncpy(ext, dotp, sizeof(ext));
 
274
                char *p, *extp = NULL;
 
275
 
 
276
                if((p = get_filename_parameter(NULL, 0, h->h.attach->body, &extp)) != NULL){
 
277
                    if(extp){
 
278
                        strncpy(ext, extp, sizeof(ext));
283
279
                        ext[sizeof(ext)-1] = '\0';
284
280
                    }
285
281
 
286
 
                    fs_give((void **) &namep);
 
282
                    fs_give((void **) &p);
287
283
                }
288
284
            }
289
285