~peter-pearse/ubuntu/natty/unzip/prop001

« back to all changes in this revision

Viewing changes to flexos/flexos.c

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2009-05-08 20:02:40 UTC
  • mfrom: (1.1.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20090508200240-7l4gypruop5863bd
* New upstream release. Closes: #496989.
* Enabled new Unicode support. Closes: #197427. This may or may not work
  for your already created zipfiles, but it's not a bug unless they were
  created using the Unicode feature present in zip 3.0.
* Built using DATE_FORMAT=DF_YMD so that unzip -l show dates in ISO format,
  as that's the only available one which makes sense. Closes: #312886.
* Enabled new bzip2 support. Closes: #426798.
* Exit code for zipgrep should now be the right one. Closes: #441997.
* The reason why a file may not be created is now shown. Closes: #478791.
* Summary of changes in this version not being the debian/* files:
- Manpages in section 1, not 1L.
- Branding patch. UnZip by Debian. Original by Info-ZIP.
- Always #include <unistd.h>. Debian GNU/kFreeBSD needs it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
  Copyright (c) 1990-2005 Info-ZIP.  All rights reserved.
 
2
  Copyright (c) 1990-2007 Info-ZIP.  All rights reserved.
3
3
 
4
4
  See the accompanying file LICENSE, version 2000-Apr-09 or later
5
5
  (the contents of which are also included in unzip.h) for terms of use.
820
820
        return;
821
821
    }
822
822
 
 
823
    /* skip restoring time stamps on user's request */
 
824
    if (uO.D_flag <= 1) {
 
825
 
823
826
/*---------------------------------------------------------------------------
824
827
    Copy and/or convert time and date variables, if necessary; then fill in
825
828
    the file time/date.
826
829
  ---------------------------------------------------------------------------*/
827
830
 
828
831
#ifdef USE_EF_UT_TIME
829
 
    if (G.extra_field &&
 
832
        if (G.extra_field &&
830
833
#ifdef IZ_CHECK_TZ
831
 
        G.tz_is_valid &&
 
834
            G.tz_is_valid &&
832
835
#endif
833
 
        (ef_scan_for_izux(G.extra_field, G.lrec.extra_field_length, 0,
834
 
         G.lrec.last_mod_dos_datetime, &z_utime, NULL) & EB_UT_FL_MTIME))
835
 
    {
836
 
        TTrace((stderr, "close_outfile:  Unix e.f. modif. time = %ld\n",
837
 
          z_utime.mtime));
838
 
        t = localtime(&(z_utime.mtime));
839
 
    } else
840
 
        t = (struct tm *)NULL;
841
 
    if (t != (struct tm *)NULL) {
842
 
        if (t->tm_year < 80) {
843
 
            df.df_modyear = 1980;
844
 
            df.df_modmonth = 1;
845
 
            df.df_modday = 1;
846
 
            df.df_modhr = 0;
847
 
            df.df_modmin = 0;
848
 
            df.df_modsec = 0;
849
 
        } else {
850
 
            df.df_modyear = t->tm_year + 1900;
851
 
            df.df_modmonth = t->tm_mon + 1;
852
 
            df.df_modday = t->tm_mday;
853
 
            df.df_modhr = t->tm_hour;
854
 
            df.df_modmin = t->tm_min;
855
 
            df.df_modsec = t->tm_sec;
856
 
        }
857
 
    } else
 
836
            (ef_scan_for_izux(G.extra_field, G.lrec.extra_field_length, 0,
 
837
             G.lrec.last_mod_dos_datetime, &z_utime, NULL) & EB_UT_FL_MTIME))
 
838
        {
 
839
            TTrace((stderr, "close_outfile:  Unix e.f. modif. time = %ld\n",
 
840
              z_utime.mtime));
 
841
            t = localtime(&(z_utime.mtime));
 
842
        } else
 
843
            t = (struct tm *)NULL;
 
844
        if (t != (struct tm *)NULL) {
 
845
            if (t->tm_year < 80) {
 
846
                df.df_modyear = 1980;
 
847
                df.df_modmonth = 1;
 
848
                df.df_modday = 1;
 
849
                df.df_modhr = 0;
 
850
                df.df_modmin = 0;
 
851
                df.df_modsec = 0;
 
852
            } else {
 
853
                df.df_modyear = t->tm_year + 1900;
 
854
                df.df_modmonth = t->tm_mon + 1;
 
855
                df.df_modday = t->tm_mday;
 
856
                df.df_modhr = t->tm_hour;
 
857
                df.df_modmin = t->tm_min;
 
858
                df.df_modsec = t->tm_sec;
 
859
            }
 
860
        } else
858
861
#endif /* ?USE_EF_UX_TIME */
859
 
    {
860
 
        zt._t.ztime = (ush)(G.lrec.last_mod_dos_datetime) & 0xffff;
861
 
        zt._d.zdate = (ush)(G.lrec.last_mod_dos_datetime >> 16);
 
862
        {
 
863
            zt._t.ztime = (ush)(G.lrec.last_mod_dos_datetime) & 0xffff;
 
864
            zt._d.zdate = (ush)(G.lrec.last_mod_dos_datetime >> 16);
862
865
 
863
 
        df.df_modyear = 1980 + zt._d._df.zd_yr;
864
 
        df.df_modmonth = zt._d._df.zd_mo;
865
 
        df.df_modday = zt._d._df.zd_dy;
866
 
        df.df_modhr = zt._t._tf.zt_hr;
867
 
        df.df_modmin = zt._t._tf.zt_mi;
868
 
        df.df_modsec = zt._t._tf.zt_se << 1;
 
866
            df.df_modyear = 1980 + zt._d._df.zd_yr;
 
867
            df.df_modmonth = zt._d._df.zd_mo;
 
868
            df.df_modday = zt._d._df.zd_dy;
 
869
            df.df_modhr = zt._t._tf.zt_hr;
 
870
            df.df_modmin = zt._t._tf.zt_mi;
 
871
            df.df_modsec = zt._t._tf.zt_se << 1;
 
872
        }
869
873
    }
870
874
 
871
875
/*---------------------------------------------------------------------------
883
887
          "warning:  cannot set info for %s\n", FnFilter1(G.filename)));
884
888
 
885
889
    s_close(0, fnum);
886
 
}
 
890
} /* end function close_outfile() */
887
891
 
888
892
#ifndef SFX
889
893